This issue stroke me suddenly and without any reason (at least I couldn’t find one). One day code that rotates picture, which was captured from camera, started to throw exceptions. I was really surprised, because I didn’t change much in the project since the time it was working just fine..Till this day, I have no idea what was the cause of it


What I figured out after some research on the Internet and looking in the generated *.appx package files (appx ~ zip – by changing extension of your *.appx to *.zip you can check what’s in it)  I discovered that for some reason the AppxManifest.xml was lacking entry with the title library mentioned in the title of this blog post (highlighted entry is the one that was missing and had to be added manually)

I couldn’t work it out how I can force mechanism standing behind creating packages (*.appx) to include this in the AppxManifest.xml, so the only solution was to insert it after package was made. To automate this process, of unpacking files from *.appx package, making amendments to the AppxManifest.xml and then repacking again all the files into *.appx pckage, I wrote a pretty ‘nasty’ PowerShell script which uses makeappx.exe (to unpack and repack) and some other PowerShell ‘hacks’ ;]

In the end, all this script does is inserting one line of code into your AppxManifest.xml file, which is

After executing this script, your package should be ready to go, and your Lumia’s (old Nokia’s) libraries shouldn’t fail again

Another blog post about struggle with weird compilation errors of universal app solution.

MdilXapCompile code 1004 - error windows cropped

This one occurs only when you’re compiling in Release configuration, otherwise it’s not bothering you. I couldn’t find any solution online (at that time) and we were helpless for about a week. Finally we overcame this issue, when my boss stumbled upon, totally by coincidence, on one of his subscribed feeds (or forums or something else) on a thread with similar description and gave me the solution.

What I had to do, was to remove all the resources files from the packages (nuget packages) folder in the solution. I searched them by the resources phrase and literally selected all the files that were ending with resources and deleted them

Resource files in packages folder - important part cropped

After deleting all the resources (I advice no to use shfit + del, but just del, so that in case of deleting something important you can recover it from the bin) problem was gone, and I was able to compile in Release mode again.


Some links, that might be useful on this matter, after quick googling:

Deploying to Windows Phone fails when using Release build

RateMyApp 1.2.4 alpha prevents Windows Phone Universal App from being deployed to device when compiled in Release


I wanted to install, as it later turns out extremely useful tools for Windows Phone development, Windows Phone Power Tools on my machine and soon after downloading installation file clicking Install I got prompted with information

Unable to install or run the application. The application requires that assembly Microsoft.SmartDevice.Connectivity Version be installed in the Global Assembly Cache (GAC) first. More information on this system update can be found by visiting the site here

and I was not able to install it after all. Obviously, first thing I did was to check the Internet what it has to say about this condition. I was a bit disappointed, because all I found was only this thread which states that you have to make some amendments to the sources and then you’re good to go. I truly wasn’t pleased that I have to go through so much effort to just install one tool and what’s worse I had to have this tool for yesterday, because I had to do some storage testing (creating and removing files and directories). Fortunately the one that posted about changing sources provided a link to already prepared package for the Microsoft.SmartDevice.Connectivity and Windows Phone Power Tools problems.

I actually did not check if those sources work because they are compressed with RAR and I did not have any tool to unpack it…who packs things with RAR ? Eh..anyway, I came to conclusion that if this installer is expecting Version 11 in the GAC I will give it to him ;]

I opened GAC directory

Starting with the .NET Framework 4, the default location for the global assembly cache is %windir%\Microsoft.NET\assembly. In earlier versions of the .NET Framework, the default location is %windir%\assembly.

And looked for a folder named Microsoft.SmartDevice.Connectivity, for me the path was


in which you can find another folder with an older or newer version (e.g. v4.0_10.0.0.0__b03f5f7f11d50a3a) of Microsoft.SmartDevice.Conectivity library. If you cannot find it go to my other post, how to install library (dll) in GAC using PowerShell


The only one thing you have to do is to create a new directory which will point to “expected version”,


then you will copy the same *.dll that already ‘sits’ in the old / newer version folder to the one that you just created.


Now try to install tools again. You fooled installer that you actually have version that it requires ;]


You can run into same problem but with Microsoft.VisualStudio.DeviceConnectivity.Interop.11.0 library. If you do, apply same “technic” as with Microsoft.SmartDevice.Connectivity library.



Disclaimer: You have to be aware that this is not actually the *.dll that you should have in the folder that you just created, and other applications that rely on this specific version can just break or do not work properly.