2

I have an ASP.NET WebApplication (not Website) that was written with C#.

I want to publish and deploy this application for more than 50 sites in my server. I would prefer to make some dlls and put them in GAC of my server so all sites will use dlls from GAC and then I can update all my sites just with replacing some dlls in GAC.

When I publish my application I get a single dll for all .cs files but all .aspx files remain. I want to merge .aspx files to single assembly too.

Is there any way?or any other idea for my case?

Mojtaba
  • 2,764
  • 1
  • 21
  • 24

2 Answers2

0

When you go to the publish settings there is an option to 'make site updatable', if you untick that all the cs code will be merged into the app_web.dll.

You will still have all the seperate aspx pages, since those define the entry point into the code. To my knowledge the only way to merge those would be to copy/paste all the seperate aspx pages into the default.aspx, and wrap them in <asp:Panel ID="HomePage" Runat="Server" Visible="False"> and then set the right panel visible in the Page_Load depending on the QueryString. You can use URL rewriting to still get nice URLs.

Depending on how many pages you have, and how big they are in code, I would probably not do this myself. But if you find the result of having 1 page outweighs the rest, it is technically possible.

Another option, maybe, is to just host the application on a subdomain and iframe it where it is needed. This might not be possible due to cross-origin problems, depending on your setup, but it would be a 'cleaner' way to work.

Hope this helped.

Christiaan Rakowski
  • 322
  • 2
  • 7
  • 15
  • @Rakowski :I can't see 'make site updatable' option,I think you talk about WebSite not WebApplication because this option exist in publishing Website.For my case it is not important that exist an entry point for each .aspx file because I can update all my sites just with replace some dll files in GAC. – Mojtaba Nov 05 '12 at 05:36
  • Yes, I just checked and that option is only available on websites, my mistake. The option to put everything into the default.aspx can still work, depending on your application this might work for you. Or maybe the subdomain/iframe. – Christiaan Rakowski Nov 05 '12 at 18:24
0

in your web project properties:

package/publish web

check - precompile this application before publishing

advanced - merge all output to a single assembly

Edi Wang
  • 3,547
  • 6
  • 33
  • 51
  • I don't have 'precompile this application before publishing' check box in 'package/publish web' tab.I use VS2010 SP1.Should I install anything?? – Mojtaba Nov 05 '12 at 09:51
  • I found solution,I installed [Visual Studio Web Publish Update](http://msdn.microsoft.com/en-us/library/jj161045%28en-us%29.aspx) and then I could do it. Thanks Edi. – Mojtaba Nov 11 '12 at 06:11