I have rather large third party ASP.NET WebSite project that I precompile and merge using MSBuild and the Microsoft Web Deployment targets. I don't precompile the .aspx and .ascx files, only the codefiles.
During the precompilation phase, the user control is compiled into an assembly that is not merged into the final WebSite.dll assembly. The final output contains:
- WebSite.dll
- App_Web_selectsinglepath.ascx.73690ebc.dll
All other user controls were compiled into assemblies with names like App_Web_abcdefgh.dll and these assemblies were merged into WebSIte.dll, just this one control was not.
What could be the cause of this behavior?
Best Answer
I had a similar issue trying to use
aspnet_compile
andaspnet_merge
from the command line for a Web App project. Two controls would always have named assemblies instead ofApp_Web_[hex].dll
, then would fail to load after the merge.In my case I was able to add the
-fixednames
flag to theaspnet_compile
call, which generated all of the control libraries asApp_Web_[control_name].[hex].dll
, which made them all visible toaspnet_merge
, which removed the assembly loading error.I still don't understand why those controls would consistently be generated with a different file name pattern (no duplicate page or control names in the hierarchy), but HTH someone.