windows phone 8.1 - MdilXapCompile error 1004 when deploying to device in Release mode -
i'm building windows phone 8.1 application. localization resources used in it's views, uses 'new' .resw
files.
for several reasons i've built application's view models in portable class library. these view models use localizable texts i've placed in .resx
files inside same project. initially, seemed working well.
today, noticed i'm unable deploy application physical device in release mode , i've determined resx-files somehow causing this. visual studio gives me error when try deploy:
dep6810 : mdilxapcompile.exe failed error code 1004. see log file 'c:\mysolution\mypclproject\obj\release\mdil\mdilxapcompilelog.txt' more details.
in log file itself:
error: compile filter argument specified non-existent file: c:\mysolution\mypclproject\obj\release\msil\en\mypclproject.resources.dll invalid argument
microsoft (r) mdil xap compiler - version 4.0.0.0 copyright (c) microsoft corporation. rights reserved.
usage: mdilxapcompile /in: /out: /config: [/compilefilter:;] [/timeout:] [/log:] [/appx]
what work?
- compiling in debug , release builds
- deploying wp emulator in debug , release builds
- running deployed software
it seems weird limitation me, far i've been unable determine why 1 (unfortunately rather important) case fails.
does know if can make resources work in debug build?
i've created blank solution (.zip 41 kb) should reproduce error. application displays resource in pcl in textblock confirm resource has been embedded.
i have ran similar problem when trying deploy physical device whether set debug or release. 1 of workarounds follow instructions on phil hoff's blog didn't work me invented own workaround.
it turns out .resx files can converted .resw (native windows phone 8.1 resource format) if these contain string values only. have developed small tool copies .resx pcl , places them in windows phone 8.1 project .resw files every build automatically. can reach them code this:
var resourceloader = new resourceloader(); var localizedtext = resourceloader.getstring("mycustomreswfile/mystringid");
also take @ question
unable access localized resources in .net 4.5 pcl windows phone 8.1
for nice binding ended creating valueconventer , small localization helper class, take @ gist: binding .resw files example
with use of can following in xaml pages:
//for resource in file page.login.resw , string id "notuseryet" <textblock text="{binding converterparameter=page.login/notuseryet, converter={staticresource resstring}, mode=oneway, source={staticresource resstring}}"/>
or string localizedtext = localizationhelper.getstring("mycustomreswfile", "mystringid");
Comments
Post a Comment