1

I am using System.Diagnostics to start a new console application to run a batch job**. I am using MVC3 running on IIS 7.5, Windows Server 2008 R2.

However, the application crashes with the following exception:

Could not load file or assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Access is denied.

I suppose this is because the process is spawned by ASP.NET or IIS and it does not have enough rights to access it.

What can be done to to allow the console app to load the required DLLs?

The application works 100% fine if ran from command line.

** The reason why I am not using a window service is summed up in this question. Basically, I am using Linq2Excel which requires the application to be complied as 32-bit. However, I am going to run the service on 64-bit Windows Server 2008 which requires all services to be complied as 64-bit.

Community
  • 1
  • 1
Extrakun
  • 19,057
  • 21
  • 82
  • 129
  • Are you using any controls or features from that assembly? Or specifically requesting that assembly in the web.config? Because depending on how you created the project, sometimes it adds that assembly in the `` tag. If you're not using anything in that assembly, but it's in your web.config, then you can remove it. Or, if you use something from the assembly in your code, there are several ways you can add/reference it. – Jon Adams Sep 10 '11 at 01:57

0 Answers0