I have a batch file that builds an ASP.NET web application project, but it's not taking in the Entity Framework resource files in the Core Compile process.
The build script is:
set proj_name=MyProject
set proj_path=C:\...\path-to-project\
set pkg_name=MyProject.zip
set build_config=Release
set platform=AnyCPU
set msbuild=%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
%msbuild% "%proj_path%%proj_name%.csproj" /t:package /p:OutPath="%proj_path%obj" /p:OutputPath="%proj_path%bin" /p:Configuration=%build_config% /p:Platform=%platform%
While the script completes without errors, but the web app crash with Unable to load the specified metadata resource
error.
But if I do a Visual Studio Publish
, everything works fine. So that points me to look into my build output.
After carefully comparing the Visual Studio Publish
output and my build script output, I found in the CoreCompile
section, the csdi
, msl
and ssdl
files are missing from my build script output. But the files are there on the file system and part of the Solution
and Project
. So I'm not sure why they are not included during the build. Below, is part of the build output:
Visual Studio Publish output:
/debug:pdbonly /optimize+ /out:obj\Release\Dnr.MotorPool.dll
/resource:obj\Release\edmxResourcesToEmbed\DataAccess\MyDataModel.csdl,DataAccess.MyDataModel.csdl
/resource:obj\Release\edmxResourcesToEmbed\DataAccess\MyDataModel.msl,DataAccess.MyDataModel.msl
/resource:obj\Release\edmxResourcesToEmbed\DataAccess\MyDataModel.ssdl,DataAccess.MyDataModel.ssdl
/target:library
/utf8output all the cs files...
My build script output:
/debug:pdbonly /optimize+ /out:obj\Release\Dnr.MotorPool.dll
/target:library
/utf8output all the cs files...
So clearly, there are 3 missing files. How do I modify my build script then?