Windows 10 PhoneCallOriginManager extension - c#

I'm trying to build an app for Windows 10 Mobile that would act as the default phone call origin manager application. For this to be possible, the user must pick this application in the settings, as there can be only one (source).
I've checked the sample made exactly for this scenario (sample on Github).
The problem is, that in the .appxmanifest file, an extension must be declared for our application to show up in the settings dialog, when selecting the default phone call origin manager app, specifically line 39.
The error message I get is:
The element 'Extensions' in namespace 'http://schemas.microsoft.com/appx/manifest/foundation/windows10' has invalid child element 'Extension' in namespace 'http://schemas.microsoft.com/appx/manifest/mobile/windows10'. List of possible elements expected: 'ApplicationExtensionChoice' in namespace 'http://schemas.microsoft.com/appx/manifest/foundation/windows10' as well as 'Extension' in namespace 'http://schemas.microsoft.com/appx/manifest/uap/windows10' as well as 'Extension' in namespace 'http://schemas.microsoft.com/appx/manifest/foundation/windows10'.
I've been looking for the cause of this, and even came across this posted issue but I do not believe that answer is correct.
Am I missing something obvious here or is this a problem with the framework itself?

I can reproduce this issue in Visual Studio 2015 update 1, but the sample works well without any problem.
In my mind it may be the incompatibility issue between the manifest file and designer. And I have reported this issue to Microsoft using the internal channel.
Because this is only a visual studio designer issue and the app itself will not be impacted, I think we can simply ignore this issue until a fix is available.
Thanks.

A addition for the answer of Fang Peng, in order to ignore this issue, in your appxmanifest xml file, you need add this information:
IgnorableNamespaces="your_ignore_name_space" in the tag, for example:
<Package ... xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"IgnorableNamespaces="mp">

Related

the namespace "system" could not be added to the project

I am working on a C# PCL. The targets include Windows Phone, iOS, and Android (all via Xamarin). Whenever I add a new class, I get a popup starting with "The namespace system could not be added to the project." It then proceeds me to warn me that things might not work. Well, they do work, but the popup is annoying. Can I stop it?
I guess this is a problem with the Framework version of the namespace systemand your project.
Confirm they both match the same framework.
I recommend you take a look over this link, which addresses a similar kind of issue. Usually when the references are not proper, you may get this kind of issue.

Getting mysterious build error after upgrading solution to Windows 8.1

I have used windows store apps 8.0 in my project and upgraded it to be 8.1. And also upgraded Visual Studio from 2012 to 2013.
First, I got an error that cannot use the Microsoft.VCLibs Version 11.0 and 12.0. So I removed the 11.0 version.
And then I got this errors:
I tried to find some information on the internet, but nothing.
Also when I double clicked on the error it doesn't bring me to the error's spot.
I have tried to do many things, and nothing helped, so I decided to write this post.
Can someone help me resolve this errors?
EDIT:
I am adding some more information, maybe this can lead to the problem:
Solved:
With the help of Hans Passant the errors have fixed. The problem was that I had this duplicate on my resource file:
I did it twice because one is for buttons (that has content), and one is for message dialogs on code behind.
In Visual Studio 2012 this code was working fine, but somehow, not in Visual Studio 2013.
I deleted the row of Cancel.Content and the errors disappeared and it works fine :)
Here is somebody else with the same problem.
I'll just copy Caplan's guidance. Look through the .resw file(s) in your project and look for a duplicated "Cancel" resource. I should note that intentionally forcing a duplicate resource produced another message when I built the program on VS2013:
1>MakePri : error 0x80073b0f: Processing Resources with error: Duplicate Entry.
1>MakePRI : error 0xdef00532: Conflicting values for resource 'Resources/String1'
Same message from either duplicating the resource in the same .resw file and by making a copy of the .resw file and adding it to the project. So Caplan's explanation isn't exactly a slam-dunk. I'd pay attention to other projects in your solution that might also have a resource named "Cancel". A likely scenario when your solution has a dependency on VCLibs, that sounds like you are mixing C# and C++/CX.
I came across this MSDN URL which seemed to be pretty helpful.
2 snippets in particular you could try:
You could actually have a duplicate resource entry in your project file.
Your obj files could have become corrupt, you need to clear out your obj files (although I haven't seen this problem for a while in my
team - it might be fixed in 2008).
If you are using a custom culture, perhaps with the .Net RegisterCulture method, ensure that the culture has been registered on
your computer. If you've reinstalled your OS and installed VS2008 and
you can't build due to this problem it could be because you need to
register your custom cultures before you build. This error seems to
be thrown when msbuild cannot find the culture.
Alternatively:
PS - There is also a Visual Studio 2012 Update 3 available that could possibly help?
Visual Studio 2012 Update 3
I hope this helps.
A similar error can also occur if you update a Nuget package in one project, but not in another dependent project also using the same Nuget package.
i.e. it can be a version mismatch error when referencing different versions of a dependency across two dependent projects.
I don't know if you have tried re-installing VS 2013, I was getting the same error but it was resolved when I re-installed.
In my case, after retargeting a working Win8 App for Win81 App, was UI string. Imho it is correct but soehow the VS2013 has some problems with it.
Locations SomeString
Locations.Text SomeStringForUI
Removing the one of them solved my problem.
Recently i got a similar build exception on my UWP Project
MakePri : error 0x80073b0f: Processing Resources failed with error: Doppelter Eintrag.
MakePRI : error 0xdef00532: Conflicting values for resource 'System.Design/ClassComments1'
I found a lot of information about the error but no solution. It looks like the error must be in the entry application project but it isn't.
In my case the VS integrated automaticly a reference to System.Activities because a made a mistake.
After i deleted the wrong reference, it works fine again.
Got this error in a UWP Xamarin.Forms project when a fellow developer referenced System.Web in a PCL that the Xamarin.Forms PCL references.
For more info:
Add System.Web Reference To A Windows 10 Universal App

Weird: C# Type or Namespace name could not be found - Builds successfully

I have a weird error showing up in my project when it is open in the VS2012 IDE. Everywhere where I make use of another referenced project it suddenly says "Type or Namespace name could not be found". And by "says", I mean it has the text underlined in red with the error when I hover over it. The intellisense doesn't work for that code. BUT (and here's the weird part), the errors do not show up in the error console and the project builds and runs fine.
I can even debug and step through the code and it works perfectly fine. So at runtime the project is referenced fine but at design time the IDE can't find it. This worked for the past 2 weeks, and only then suddenly went a little bonkers. It's really annoying because I am rubbish at coding without intellisense!
Has anybody ever seen anything like this or have any suggestions?
I had this. I referenced assemblies whose "Target Framework" were set to ".Net Framework 4" in the "Application" secion of the projects properties. I changed this to ".Net Framework 4.5" not just in the referenced assembly's project but also the project I was building and it worked. Give this a try.
I have found this is a known problem with VS2012. Check to see how you are building, 64 bit or 32 bit. It won't work with 64 bit but it will with 32 bit. It will say things are missing and design will not work, however the program will run fine. I have heard the new VS update that hasn't been released yet will fix it.
Manually delete all the references to the libraries of the other projects and re-add. Intellisense rebuilds whatever it needs at that point and doing this has helped me in the past.
Another source of this problem is a solution with multiple projects containing code for the same namespace. The compiler can handle this. Intellisense won’t.
Related to a couple other answers here, I had a "Data" project using a "Data" namespace. Built fine, but just started recently showing errors from intellisense (even though it continued building fine.) (VS 2015.)
I fixed this by changing my "Data" project and namespace to "MyCompany.Data".
Oddly, the problem didn't seem to show up until recently, but making the change did fix it. Presumably there was a conflict in namespace with another project or reference, which can build fine, but intellisense can't handle.
You can change this in the Application tab of Project properties. You can also open up an EDMX diagram, right click, choose model browser, choose the second collapsable item in the model browser tab, hit properties, and there you'll find the Namespace option for generated Entity Framework entities and contexts. (Similiarly, if you modify an Entity Framework Model's namespace, you might also need to change the related connection to match [in Web.Config for ASP.Net and MVC.])
Make sure that there is no class with the name same as Project default namespace.
make sure that you don't reference .net framework 4.5 projects in .net 4 projects!
Examine your .proj files in a text editor and make sure the paths to your references are correct.
This can also happen if you set the Build Action to "None" on the referenced file and forget about it.
I had the same problem, where it would build and run fine, it just would always show that error and I couldn't use intellisense with the class.
I actually used the automatic method of creating the class in a new file to resolve the issue, then just copied the code over from the real class. I deleted the old file, renamed the new file, and now it works.

Grid is not supported in a Windows Presentation Foundation (WPF) project

I am learning how to create a Class Library (Windows Store apps) and used a UserControl template to add a user control to it.
Then I added a Grid tag to accompanying XAML. However, the tag is underlined with blue squiggles and when I hover over the tag there is
Grid is not supported in a Windows Presentation Foundation (WPF) project
tooltip shows up.
The library seems to build without errors. I've added the library to an application and use the control in its code. The application is also builds just fine. However, when I run the application I get XamlParseException exception.
I am using Visual Studio 2012 RTM. Both the library and the application reference only two standard assemblies (.NET for Windows Store apps and Windows).
What I might done wrong and how should I fix the library?
In my case I switched from Debug to Release, and then back, and the error was gone.
Go to "Build > Configuration Manager..." and Make a new platform for x86 for all your projects.
It doesn't have to be the active one, you can leave that as Any CPU.
Hope it works as for mine...
I've recently had the same error and found the following in the output window:
10>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFX.targets(268,9): error MC6000: Project file must include the .NET Framework assembly 'WindowsBase, PresentationCore, PresentationFramework' in the reference list.
The solution for me was to add the missing references to my project.
For me it helped to set the "Target framework" in application-properties to .NET 4.0
This appears to be a bit of a "catch-all" for a number of XAML resource errors. I've found two causes so far:
Declaring a Resource outside of the appropriate context- e.g. directly in a UserControl tags, not UserControl.Resources.
Forgetting to include the correct namespace for the "unsupported" class. Example in a basic ResourceDictionary, with no sys namespace defined:
<ResourceDictionary>
<sys:string>I'm not supported</sys:string>
</ResourceDictionary>
I was able to solve my similar issue of..
UserControl is not supported in a Windows Presentation Foundation (WPF) project
.. by removing the PresentationFramework reference and re-adding it via nuget.
[Reposting comment as answer]
I was able to complete the steps with no issues, and it appears you were able to as well. Perhaps there was some other inadvertent modification/setting that was made?
This is xaml getting itself confused. I have the error on one project and not on another. Have a look at the top of the xaml before the grid error and see if there are any references to other controls. Try making a modification that will cause and error and rebuilding one of those controls. Then put it back the way it was to get a succesful build and see if this makes the grid error go away. (it did for me)
Much Like Felix D.s answer, I found from the .csproj file a reference was removed.
Obviously replace the 3 with your needed framework, or use the project properties to set the version ( i think that adds this reference )
Evil Dog Pie was step 1 for me, as some other issues came up. There is always a heap of information in the output log
<Reference Include="PresentationFramework">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
This problem is due to the low version of .NET that you have chosen in your project.
To solve the problem, select the Project from the up menu and then select your Project Properties and from the part of Target Framework select higher version of .NET Framework!
I hope your problem is solved.
Yours sincerely

Script# and compiler problems

I've just come across a pretty strange problem with VS2010 and Script#, which most of the time I am able to re-create.
In my simple scenario I have 2 projects in my solution; a standard Asp.Net MVC2 Web Application, and a Script# jQuery Class Library. I created a static class (attributed with [Imported]) with a static method on it, the intention being that I can map this class in code to an external Javascript library, as described in the documentation.
However, it seems that whenever I decorate such a class with [IgnoreNamespace] to achieve this goal, the project stops successfully compiling but doesn't give me any feedback as to why it's failing (no errors in the error window, for example). It's not easy to get rid of either, as Visual Studio seems to get into a permanent state of not build failure; removing the classes and project files doesn't solve it, nor restarting visual studio. The only way I can get VS to build the project successfully is to delete the project entirely, create a new one then add the files back in, which is annoying to say the least.
With a verbose build output setting, I get the following:
Target "AfterCompile" in file "C:\Program Files (x86)\ScriptSharp\v1.0\ScriptSharp.targets" from project "e:\project\local\ScriptSharpDemo\Scripts\Scripts.csproj" (target "Compile" depends on it):
Task "ScriptCompilerTask"
Done executing task "ScriptCompilerTask" -- FAILED.
Done building target "AfterCompile" in project "Scripts.csproj" -- FAILED.
.. which doesn't tell me whole lot.
There have been a couple of times where I have managed to create this type of class and then successfully build, but mostly I can reproduce this problem pretty reliably.
At this point I'm inclined to think that the bug lies with Script#, but would just like to have that confirmed, and to find a possible work around if there is one.
Just in case anyone is having a similar issue, I've found the cause of the problem.
When adding a class using this method, or copying in a file from another project for use within Script#, this causes a reference to System.dll to be added to the project. This (understandably) causes the project to stop compiling without error.
It would be nice to have a warning about this or for Script# to somehow detect when this situation occurs and/or create a new template for when I use 'Add class' or import a file, but it is just a convenience issue and at least now I can painlessly get my project compiling again just by removing this reference.
When trying to make my project build again, I came across the following, possible solutions:
The "Home\HomePage.cs" and "Shared\Utility.cs" must not be deleted and remain where they wre initially created
The "Home\HomePage.cs" and "Shared\Utility.cs" must be the last entries in the "*.csproj"-file. After them, no "Compile" tag should follow
Problematic calls to "Script.Literal" might cause silent fails - especially be careful when having parameters (like Script.Literal("{0}.doFoo()", variable))
The same seems to be true for "String.Format" when the format parameters are invalid
Namespaces and folders seem to cause many problems, putting all classes into the same namespace and all classes into the same folder might help
I tried all of the suggestions that have been given here, but continued to see the issue. Eventually, I determined that the cause in my situation was that I had added an [IntrinsicProperty] attribute to one of my properties. Removing it solved the issue. Don't ask me why this was causing a problem, but I thought I would share this solution in case others run into it.

Categories