6

In development, our Asp.Net 4 website takes a fairly lengthy time to start after the project libraries are built

We do a fair amount of population of statics etc, but not enough to justify the length of time it takes the app to come up (probably 3-4 minutes)

We aren't building the website, just the libraries, and batch != true in the compilation element in the .config file.

I will try log some diagnostics, but any other pointers would be useful

Matt Evans
  • 7,113
  • 7
  • 32
  • 64

4 Answers4

9

You can also try the optimizeCompilations="true", on the compilation session of web.config.

<compilation debug="true" batch="false" optimizeCompilations="true" >

My site also makes too long to run for the fist time, after I compile my dll's.

Aristos
  • 66,005
  • 16
  • 114
  • 150
  • That sounds interesting. I'll investigate and give it a go. – Matt Evans Apr 05 '11 at 14:15
  • 1
    @Embo just be cerfull for this situation: When you use a function(var1, var2, var3 = some default), if you change the input variables, eg you make it function(var1, var2, var3 = some default, var4 = some default), then you need to find all aspx files that you use it, open change a line and saved again, because this flag make cache of the used functions and if the used function have default variables, and you change that, this cache can not understand it. – Aristos Apr 05 '11 at 14:18
  • @Anicho there is a patch from Microsoft for previous versions. – Aristos Dec 05 '11 at 14:36
  • 1
    Excellent solution - I have a very large project that contains other projects DAL, BLL etc. This has really helped speed up PLL development. – George Filippakos Nov 12 '13 at 17:34
  • 1
    Nice..Its Working..Thanks@Aristos – Arun D Jun 27 '17 at 08:34
2

Hope the below steps will reduce your time

Close your project then delete the 'Visual Studio Solution User Options (.suo)' file and reopen the project

Ashaar
  • 467
  • 1
  • 4
  • 15
  • +1 It worked for me. My application used to take more than 30minuted too build and after this solution it gets build quickly. – RSB Nov 20 '15 at 14:52
0

The right thing to do here is to use either dotTrace or Dynatrace to profile and understand what is the problem. It will tell you how long it takes to execute all your code.

Another potential issue is that your solution is not finding the appropriate libraries. Turn on fusion log viewer to determine if there are any assembly binding failures.

xmorera
  • 1,933
  • 3
  • 20
  • 35
  • And how would one perform the dotTrace or Dynatrace? – styfle Aug 18 '17 at 18:28
  • Download it and it is pretty easy to use. https://www.jetbrains.com/profiler/download/ Profiling is one of those things that really makes a difference when in need. – xmorera Oct 31 '17 at 19:25
0

if you have a lot of projects linked to the solution, when you do a build it will build EVERY project. if you have projects that you aren't making changes to, it is acceptable to remove the project itself and reference directly to the .dll.

Patrick
  • 7,512
  • 7
  • 39
  • 50
  • Yes, I know. There are only six projects, they all build reasonably quickly. It's browsing to a page in the site after the build which takes a long time. – Matt Evans Apr 05 '11 at 14:05
  • so once the site is completly loaded and you try to browse, it takes 3 - 4 minutes to go from page to page... or is it just ONE specific page that takes that long to load? – Patrick Apr 05 '11 at 14:08
  • The first page, thereafter it's mostly fine. – Matt Evans Apr 05 '11 at 14:16