Repro: deploy https://github.com/KuduApps/MvcApplicationEFSqlCompact to Kudu and run it
Result: it fails with MetadataException: Unable to load the specified metadata resource
MetadataException: Unable to load the specified metadata resource
When we build WAPs on Kudu, we use a command line that looks like this (simplifying a bit):
MSBuild.exe MvcApplicationEF\MvcApplicationEF.csproj /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="c:\output"
While it works fine in most scenario, it turns out that it doesn't fully build everything, causing the assembly to be missing it's EF resources. Normally, it looks like this (using reflector)
But we end up without the whole Resources tree, causing the app to break at runtime.
The fix is to pass an extra /t:Build param to make it do the correct build, e.g.
MSBuild.exe MvcApplicationEF\MvcApplicationEF.csproj /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="c:\output"
We will fix this in Kudu, but in the meantime the same can be achieved using a custom build script, as shown in KuduApps/MvcApplicationEFSqlCompact@b73805e.
@amitapl you fixed this one, right?
Unfortunately this was broken again recently. :( The log shows a few warnings about mismatch between the processor architecture and one error on EF:
SGEN : error : An attempt was made to load an assembly with an incorrect format: \EntityFramework.5.0.0\lib\net45\EntityFramework.dll. [\VirtualDirectory0\site\repository\WebAPI\WebAPI.csproj]
An error has occured during web site deployment.
Again, works fine deploying straight from VS2012. Can someone help look into this? Thanks much!
@happytrails would you mind opening a new issue to track this new problem, as this looks like a different thing. Thanks!
Added /t:Build to msbuild command line to fix issue #262 (for origina…
…l site builder).
Fixed, and verified with the repo to make sure it works.
Do we want to add a test for this repo?
Yes, maybe we can add that to https://github.com/KuduApps/Mvc4ApplicationFx40WithLib.
I'm having the same problem right now on Azure.
Is your fix in production or not yet?
Sorry, not yet. Hopefully around the end of the month.