Question

I use aspnet_compiler to precompile an asp.net website. Then, I run aspnet_merge to merge the precompiled assemblies into one.

Unfortunately, aspnet_merge does not include one of the assemblies in its merge process. Therefore, this assembly remains unchanged. Even more unfortunate, this assembly references one of the assemblies that did get merged (and is now deleted) and this reference is not updated by aspnet_merge. Therefore, I get a FileNotFoundException "Could not load file or assembly" when this dll is used.

So far, I figured out that after the precompilation step, most assemblies are named like

App_Web_xxxxxxxx.dll. 

whereas the offending dll is named like:

App_Web_nameofusercontrol.ascx.xxxxxxxx.dll

I guess this is why aspnet_merge ignores it. I confirmed that aspnet_merge ignores by using the -log option, it generates a list of input assemblies.

I call aspnet_compiler and aspnet_merge like this:

aspnet_compiler.exe -v VirtualDirectoryName -p ActualDirectory c:\precompileoutput
aspnet_merge.exe c:\precompileoutput -o mergeddllname

I'm currently looking at the decompiled aspnet_merge code, trying to figure out what logic it employs when it decides which dlls to merge, but perhaps someone has seen this issue before or has suggestion?

I'm looking for a way to either have aspnet_compiler produce dlls that aspnet_merge understands, of for a way to convince aspnet_merge to update all assemblies that reference any of the app_web* dlls it deletes. Thanks!

Update: aspnet_merge ignores the App_Web_nameofusercontrol.ascx.xxxxxxxx.dll, because aspnet_compiler does not generate a corresponding .compiled file. Also, the usercontrol seems to also be compiled into one of the App_Web_xxxxxxxx.dll assemblies. However, I don't know why the same user control is compiled into two different assemblies. Perhaps a strange circular reference problem?

Was it helpful?

Solution

Turns out the problem was caused by one usercontrol U1 in folder A referencing another control U2 in Folder B when a third control u3 in folder B referenced U1, resulting in a circular reference. Moving U2 to folder A seems to solve the issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top