Reputation: 3467
I am using VS2015, and MSBuild 14.
My solution has many projects, but three of them are old ASMX web sites. The ASMX website "projects" don't have their own project files, but are detailed in the XML of the solution file itself.
The solution builds fine inside Visual Studio.
However, when I try to build on the command line with MSBuild, I am getting an error message. Here is my MSBuild command:
C:\> msbuild MySolution.sln /t:MyAsmxProject
All the dependent projects (mostly c# class libraries) are built as I would expect them to be. Lots of output to the cmd window in which msbuild is running, until we get to the following action by msbuild:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v /MyAsmxProject
-p MyAsmxProject\ -u -f -d -fixednames Precompiled\MyAsmxProject\
The whole thing bombs out here with the following error:
ASPNETCOMPILER : error ASPCONFIG: Could not load the assembly.
The property 'assembly' must be a valid assembly.
[C:\My\Long\Path\MySolution\MyAsmxProject.metaproj]
Now at first I didn't know what a "metaproj" file was, and was unable to find that file, but I did understand it to be an intervening project file created internally so that msbuild could operate on solution files. I discovered that I could see the metaproj file if I set the environment variable:
set MSBuildEmitSolution=1
And then re-ran the msbuild command. I now have metaproj files for both my solution and for my asmx project, which would appear to be the one referenced in the error message above.
These are both pretty dense msbuild files, but neither one of them have an XML node (element) named "assembly" and neither one of them have any XML nodes with the attribute or property "assembly" applied to them.
So I am unclear what this error is saying and how to fix it. And doubly unclear as to why it crops up with msbuild, but not with visual studio.
Any insights or suggestions most appreciated.
Upvotes: 0
Views: 1200
Reputation: 3467
Although I don't fully understand why, I have found a solution.
Namely, if I run the command window in which I am doing the msbuild as an administrator, I don't get this error. This is an acceptable solution for me.
However.... it would still be great to understand more specifically what the error means, and why being an adminstrator makes the difference.
Upvotes: 1