views:

149

answers:

1

I am unable to get the -fixednames switch to create dlls for the cs code behind files. The files in the bin folder are compiled aspx pages, but the code behind files are all compiled into one large websitename.dll file.

Here is my command with switches. aspnet_compiler -v / -p E:\Source\DotNet4\mysolution\website -f -d -fixednames E:\Source\DotNet4\CompiledWebSite

This produces many files in the bin folder.

website.dll and website.pdb (contains code behind) myform1.aspx.643c7876.dll (compiled aspx layout ui)

I have tested this over and over to make sure I am not missing anything. The test is place a label on myform1.aspx, and in the codebehind populate the label with some text. Compile the website with the above switches and deploy the website.

Make a change to the myform1 codebehind and change the label text. Compile and only deploy the myform1.aspx.643c7876.dll to the website. Result: label is still the same. Now deploy the website.dll and pdb and the label changes.

Can anyone tell me how to get -fixednames to create sinle dlls for codebehind?

A: 

I think the difference really is in the Web Application vs. Web Site concept. I created two identical apps - one as a Web Application, and one as a Web Site, in Visual Studio. The page was default.aspx, and the class is "_Default". When I ran "aspnet_compiler -v / -p . -f -d -fixednames ..\CompiledSite" on the Web Application, there were 2 dlls in the new bin, one called WebApplication1.dll, and it contained the _Default class, and one called App_Web_default.aspx.cdcab7d2.dll, which contained the markup. When I compiled the WebSite with the exact same command line, it only created one DLL, with both the markup and the _Default class.

Don't ask me how it knew the difference between the two - the only thing I can think of is the fact that the csproj file exists for the Web Application.

From what I've read and the way I understood things, aspnet_compiler was designed for WebSite projects, not Web Application projects, which is why I assumed you were using a WebSite.

If you need your application designed to be single-paged DLLs, try building a new WebSite project, adding your .aspx and .aspx.cs files to that WebSite, and compiling with your aspnet_compiler command, and see what happens. You can start with just one or two pages for a sample.

You won't need to actually test and recompile etc. in order to determine if it worked - just look at the DLL files in Reflector, and see where your classes live - if they live in the same DLL as the markup, then it worked, otherwise, they must be in the centralized application DLL.

Hopefully that all made sense - good luck.

Joe Enos
Joe, thanks for getting back with me. Our website was a "website" project, but we had to change it to a webapplication project when we started adding MVC pages. Yes, the single page dll's work in a website project, but apparently not in a webapplication project.
Terrence