Error code 2001:There are duplicate files in AppManifest.xaml. Remove one of the files and then try again - windows-phone-8

I have made an app For Winodws Phone 8 platform and I am publishing it in Windows phone 8 store.All is well but at the end the error appears:
Error code 2001:There are duplicate files in AppManifest.xaml. Remove one of the files and then try again.
I have searched a lot on google, I have cleaned my solutions, rebuilt the solution, cross checked the manifest file but all in vain.

Goto ur_proj_folder/bin/release and open appmanifest.xaml in a notepad and check for repeated refrences of namespace :) Hope it helps

This usually happen if you have a duplicate reference to dependent dll. e.g. I have added reference of Advertising sdk of two different versions at one.

As Niwin said, the problem are the duplicated namespace's references in "Release/AppManifest.xaml", but the cause are the References added to the project, in my case when i added manually the "Microsoft Advertising SDK for Windows Phone 8.1 (Silverlight)" this dll started to conflict with "Microsoft.Advertising.Mobile.UI.dll", cause they have the same name. Just remove the reference and the problem will be gone.

Related

Can't build debug version Azure Function in Visual Studio

I'm trying Azure Functions for the first time and have been able to build and publish "Release" versions without any issue.
I want to step through the code and so need to create and publish a "Debug" version but when I try and build I get the following errors with the same code:
CS0579 Duplicate 'System.Reflection.AssemblyCompanyAttribute' attribute
CS0579 Duplicate 'System.Reflection.AssemblyConfigurationAttribute' attribute
CS0579 Duplicate 'System.Reflection.AssemblyFileVersionAttribute' attribute
CS0579 Duplicate 'System.Reflection.AssemblyInformationalVersionAttribute' attribute
CS0579 Duplicate 'System.Reflection.AssemblyProductAttribute' attribute
CS0579 Duplicate 'System.Reflection.AssemblyTitleAttribute' attribute
CS0579 Duplicate 'System.Reflection.AssemblyVersionAttribute' attribute
From researching this error the main suggestion has been to remove them from the AssemblyInfo.cs file but rebuilds just put them back in again and the "Release" version is happy with these settings being there.
What am I missing so I can create a "Debug" version of the code?
Thanks
According to your description about CS0579 Duplicate error ,I suppose some temporary *.cs files generated during compilation got accidentally added to the project. The files were from the obj\Debug directory, you could try to delete these files to solve problem. For more details, you could refer to this SO thread.
In my case, some temporary *.cs files generated during compilation got accidentally added to the project.
The files were from the obj\Debug directory, so they definitely shouldn't have been added to the solution. A *.cs wildcard went a little crazy and added them incorrectly.
If it doesn't work, there are also other solutions you could have a try. Such as right click project name>choose Edit FunctionName.csproj. Edit the csproj and turn the generation of the attributes causing the issues off. More solutions you could refer to this article.
Resolution
I found this issue on GitHub where there were a couple of options to resolve this issue which I am going to cover here plus a third option I tried not mention in the issue.
I have managed to now get the Debug to build by following one of Janley's link and adding 4 extra lines into the .csproj file:
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>

Package Acceptance Validation Error: Package contains multiple files with identical names

Whilst building an old Windows Phone 8 app with Visual Studio 2015 I've come across and unusual error when I upload the built .XAP to the store. It throws the error:
Package acceptance validation error: Package cannot contain multiple files with identical filenames. Please correct the following files: Assets\ApplicationIcon.png, Assets\Background.png
I can view the contents of the .xap file by renaming the file to a .zip and looking inside. Sure enough there are two files with the same name (something I didn't think was even possible!):
This app built fine in other versions of Visual Studio - any idea what is going on and how to fix this?
After some investigation it seems the root cause of the problem can be found in WMAppManifest.xml file in Properties.
<IconPath IsRelative="true" IsResource="false">Assets/ApplicationIcon.png</IconPath>
<SmallImageURI IsResource="false" IsRelative="true">Assets/Background.png</SmallImageURI>
<BackgroundImageURI IsResource="false" IsRelative="true">Assets/Background.png</BackgroundImageURI>
Simply changing all the forward slashes to backward slashes fixes the problem.
<IconPath IsRelative="true" IsResource="false">Assets\ApplicationIcon.png</IconPath>
<SmallImageURI IsResource="false" IsRelative="true">Assets\Background.png</SmallImageURI>
<BackgroundImageURI IsResource="false" IsRelative="true">Assets\Background.png</BackgroundImageURI>
And here is the inside of the .xap - no more duplicate files!
No more duplicate files!
This is an intensely annoying issue, I hope if anyone out there is still using Windows Phone 8 and comes across this it helps!

SignTool error while packaging Windows Store app

During packaging the Windows Store application, I get an unspecified error [APPX1204]:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\AppxPackage\Microsoft.AppXPackage.Targets(1139,9): error APPX1204: Failed to sign 'D:\Projects\VS2012\Stroik\Stroik\AppPackages\Stroik_1.0.0.11_AnyCPU_Test\Stroik_1.0.0.11_AnyCPU.appx'. SignTool Error: An unexpected internal error has occurred.
Build output refers to the part of a file generated by VS2012:
<SignAppxPackage AppxPackageToSign="#(FinalAppxPackageItem)"
CertificateThumbprint="$(PackageCertificateThumbprint)"
CertificateFile="$(PackageCertificateKeyFile)"
HashUri="$(_HashUri)"
EnableSigningChecks="$(EnableSigningChecks)"
>
<Output TaskParameter="ResolvedThumbprint" PropertyName="ResolvedThumbPrint"/>
<Output TaskParameter="AppxPackagePublicKeyFile" PropertyName="AppxPackagePublicKeyFile" />
</SignAppxPackage>
Yesterday packaging proceeded successfully. Today I added aditional logic to my app and changed some data in manifest. Since then I'm reciving presented error. I tried to regenerate Certificate in Packaging menu, delete Store/Temporary Keys (then regenerate), ... much more but nothing helps.
Now I have no idea how to handle it. Furthermore packaging a new project (as it is provided by vs2012) results in the same error.
Have you got any suggestions how to solve it.
If it helps anyone else, I was trying to make the build on a network share (virtualizing windows). Creating it on the Windows partition solved the issue.
I was developing on a Virtual Machine in VirtualBox and tryed to publish to the shared folder.
Change the output folder to a local folder on the virtual maschine solved it.
Granted this is older - see if you can try it with a different live id
You could also try to generate a new app, and diff the manifests between the apps.
Now according to:
http://social.msdn.microsoft.com/Forums/en-US/toolsforwinapps/thread/f25939fb-c48c-4bd0-938e-6a0afbd2dca0/
you may want to sign out, use IE 'in safe private browsing' and create a new one.
Also ensure that IE is set in "Browsing History->Settings" to get a new version of the page every time.
Login with the new one and give it a try.
I'm not sure if this error is related here or not, but it's a starting point based on the prior feedback on the above post.
This japanese site lists the same error code and seems to have the same resolution as well
http://coelacanth.heteml.jp/blog/windows-8signtool-error-an-unexpected-internal-error-has-occurred/
Its worth a shot, but I'll admit on this one not being 100% sure, just trying to help out : )

Problems including comdef.h

I'm trying to port some existing code to WP8 and have come across a problem.
The code i am porting uses a smart pointer thats is defined in comdef.h but for some reason when I try and include comdef.h I get the following error.
comdef.h(25): fatal error C1083: Cannot open include file: 'olectl.h'
I understand what the error means and it seems there is no trace of "olectl.h" in the WP8 SDK include paths on my machine. Is anyone else having this problem, I've tried "repairing" my installation of "Visual studio 2012 Express for Windows Phone"
I have found some code that appears to include comdef.h and has gotten around the missing macro problem the link at the end of this post is talking about by not using the macro at all and explicitly using the code that the macro would expand to.
(Here is the code that does what I want to: https://devel.nuclex.org/framework/browser/graphics/Nuclex.Graphics.Native/trunk/Source/Rasterization/Direct3D11/Direct3D11Api.h?rev=1782)
Has anyone else experienced this, or could someone with the SDK installed try including comdef.h somewhere to see if it works for them.
The missing macro link:
http://connect.microsoft.com/VisualStudio/feedback/details/751127/com-smartptr-typedef-causes-errors-when-used-in-winrt-build
Thanks.
Yes, I see this too, so it appears this is "by-design".
Basically if the API isn't listed on MSDN in the list of supported COM/Win32 APIs, then it isn't a supported API on Windows Phone 8. It looks like only the combaseapi.h header is supported.
_com_ptr_t<T> and it's friends aren't on the list...

Referencing ZXing.Net library

I need to reference the ZXing library to scan QR codes in my Windows Phone 8 app.
I have downloaded the ZXing.Net 0.10.0.0 from the following source: http://zxingnet.codeplex.com/
However, whenever i try to add a reference to zxing.wp8.0.dll, I get an error as follows:
A reference to higher version or incompatible assembly cannot be added
to the project.
Can I please know why am I getting this error. Is there anything that I am doing wrong or missing?
Right click on the DLL in File Explorer --> Click Properties --> Choose unblock. Then try to add a reference again.
VS2012 has the absolute worst error message for when DLLs are blocked due to the fact they were downloaded from the web.
Goto
http://nuget.org/packages/ZXing.Net
Follow the instructions to install the right version you need.