2

Years back I inherited a project that is written in VB.net - the problem with this site (it's a website in Visual Studio, not a web application) is that if you change any code you have to compile and upload the entire site each time.

Why? Because it seems to generate a bunch (maybe 10-15) of randomly named DLLs in the BIN directory on every compilation. Each page in the site then references these randomly named DLLs so I have to upload them all and the new DLLs if the site is to continue working.

What 'setting' is this site built using, or more importantly how can I change it to a more convenient system of generating one or two consistently named DLLs?

Justin
  • 84,773
  • 49
  • 224
  • 367
Full Time Skeleton
  • 1,680
  • 1
  • 22
  • 39

3 Answers3

4

Changing Web Site to Web Application could be a good solution, but it could take many pros and cons, and yo need time to change and manage this.

Changing the following flag, will allow to just remove the random App_web_xyz.dll

 Solution Explorer
  Publish Website
   Precompile during publishing 
    Configure
     Merge options
      [X] Do not merge 

Change to

      [X] Merge each individual folder output to its own assembly

or to

      [X] Merge all pages and control outputs to a single assembly

Be careful, after this change, if 2 different .aspx file have the same class name will cause a publish error! You have to refactor 'n rename each duplicate class.

Emanuele Greco
  • 12,551
  • 7
  • 51
  • 70
2

this is the default behaviour of a web site project which differs from web application project.

check here for more details:

ASP.NET Web Site or ASP.NET Web Application?

Community
  • 1
  • 1
Davide Piras
  • 43,984
  • 10
  • 98
  • 147
1

If you want get rid of many annoying DLLS - convert Web Site to Web Application otherwise use Web Deploy feature

Some tips:

  • Each project generates own DLL so you can not have less DLLs than number of projects in your solution
  • Visual Studio provides nice Deploy and Publish feature which check whether file has been changed and deploy onle updated files so you basically click one button and deploy is done for you

Some links:

sll
  • 61,540
  • 22
  • 104
  • 156
  • I know about these settings but they don't work in this case, if I use 'Publish' it generates all the files and all those randomly named DLLS. There's not less DLLs than the number of projects, there's 1 project and about 15 randomly named DLLs! – Full Time Skeleton Oct 26 '11 at 10:19
  • @Full Time Skeleton : if you want get rid of many annoying DLLS - convert Web Site to Web Application otherwise use Web Deploy feature – sll Oct 26 '11 at 10:21
  • Thing is, guy I work with uses Web Sites all the time. He sets the site up in IIS then accesses it through Visual Studio and begins the build process from there. He never has any random DLLs created and ends up with a nice clean BIN folder with no weird references in his files. – Full Time Skeleton Oct 26 '11 at 10:29