4

I have a wcf service hosted on my website (Windows Server 2003 with iis 6, Dot Net Framework 4.0).

When I deploy this service, it runs on the production server. But after a day, this service stops & I get an error :

The service could not be activated due to an exception during compilation. The Exception Message is. Could not load file or assembly App_web_jm4, Version = 0.0.0.0. The system cannot find the file specified.

To solve this, I had to make an iis restart (a very bad solution) coz still I got this error the next day.

Somewhere I read that changing this tag of web.Config solves the problem :

<compilation targetFramework="4.0"  batch="false">

It indeed solved my problem.

But I want to know :

1) Are there any performance implications of above solution to my website because the documentation does not say much about the impact when value of this batch setting is false.

2) Are there any other solutions available ?

These solutions did not help me.

EDIT : Since It is classified as a duplicate of web.config batch="false":

This is what I understood from that post :

Batch mode = true -> The Compiler compiles all files separately for the first time & subsequent request come from there.

Batch mode = false -> The Compiler compiles all files together.

That means I incur a performance penalty & is not a good solution to my problem..

But About the second part :

The documentation says

When this attribute is set to True, ASP.NET precompiles all the uncompiled files in a batch mode, which causes an even longer delay the first time the files are compiled. However, after this initial delay, the compilation delay is eliminated on subsequent access of the file.

When BatchMode is true (the default) then Why is it attempting to recompile the service ? ( As The exception says "error during compilation" )

Am I missing out something ?

Community
  • 1
  • 1
Abdul Rehman Sayed
  • 6,532
  • 7
  • 45
  • 74
  • 1
    When you change the web.config what do you change it **from**? – Liam May 19 '15 at 08:42
  • 1
    I added Batch=false. in that line – Abdul Rehman Sayed May 19 '15 at 08:43
  • Related: [web.config batch=“false”](http://stackoverflow.com/questions/667653/web-config-batch-false) – Liam May 19 '15 at 08:47
  • These two links suggest to add batch="false" to improve the performance which make me confused: [Here](https://books.google.com/books?id=1YLp0JDGwUMC&pg=PT515&lpg=PT515&dq=batch%20false%20performance&source=bl&ots=D3elRxf1ZW&sig=rrA0CooNU3gCH8UdOCpw0QRs8Mg&hl=en&sa=X&ved=0ahUKEwiNvv6hyM_YAhXNu1MKHR-oDLAQ6AEIcDAJ#v=onepage&q=batch%20false%20performance&f=false) and [Here](https://blogs.msdn.microsoft.com/perfworld/2010/01/13/how-can-i-disable-batch-compilation-for-my-asp-net-web-pages-so-that-the-first-user-accessing-the-web-site-doesnt-experience-slow-performance/) – Muhammad Musavi Jan 13 '18 at 06:16

0 Answers0