1

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?

Michiel van Oosterhout
  • 22,839
  • 15
  • 90
  • 132

2 Answers2

0

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.

Kevin Gorski
  • 3,745
  • 1
  • 22
  • 16
-2

User controls are compiled into separate assemblies because this allows you to treat your user controls as web controls. You can use ILMerge utility to merge multiple assemblies into one. Here is a good page explaining this.

Alex Polkhovsky
  • 3,340
  • 5
  • 29
  • 37