Is it possible to use a portable library with localized resources in a universal application?

advertisements

(There's a link at the bottom to a solution with repro of the problem.)

I've been using a portable library with .resx resources for quite some time as it worked for both Windows Store apps and Windows Phone apps. I tried to use it with a Universal app as well, and it works for the Windows Store part, but does not work for Windows Phone.

The problem occurs only when I try to deploy the app on a device (built with the Release configuration). If I just Build it, it does not give an error (but it still can't be deployed on the device successfully). I get the following error:

Error : DEP6810 : MdilXapCompile.exe failed with error code 1004. See log file
'...\Phone App Test\Phone App Test\obj\Release\MDIL\MDILXapCompileLog.txt' for more details.

And in that file:

Error: Compile filter argument specified non-existent file:
...\Phone App Test\Phone App Test\obj\Release\MSIL\en-US\PCL.resources.dll
Invalid argument

The file truly isn't there, but the app does not support the en-US culture anyway, only the library does, so I don't think this file should be needed.

Any idea how I can resolve this issue?

Here's a simple solution with the problem: link


You can have .resx files in pcls, you just have to use the workaround explained on http://blogs.msdn.com/b/philliphoff/archive/2014/11/19/missingmanifestresourceexception-when-using-portable-class-libraries-in-winrt.aspx

Even with the latest VS 2013 (update 5) the mdil error will appear when trying to deploy Release packages.

MdilXapCompile.exe failed with error code 1004

To work around it you must compile your app using the store option and then use the Application Deployment tool to actually deploy it to the device.