简体   繁体   中英

Visual Studio project randomly named DLLs

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?

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.

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?

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:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM