R – ASP.NET precompile fails to merge a single user control


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 Solution

I had a similar issue trying to use aspnet_compile and aspnet_merge from the command line for a Web App project. Two controls would always have named assemblies instead of App_Web_[hex].dll, then would fail to load after the merge.

In my case I was able to add the -fixednames flag to the aspnet_compile call, which generated all of the control libraries as App_Web_[control_name].[hex].dll, which made them all visible to aspnet_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.

Related Question