Couldn’t load assembly Antlr2.Runtime access denied

I had an interesting error happen when I was trying to run an asp.net MVC app for the first time which I have been assigned on my LR desk. Once the application gets loads it throws and error could not load file or assembly ‘Antlr3.Runtime or one of its dependencies access denied.

I was messing around with this error for almost 4 hours and tried everything I found on Internet.

  • Enter %TEMP% in the File Explorer and delete all the temporary files.
  • C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
  • C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files

But nothing worked for me.

Then I found that we have enabled identity impersonate in web.config

<identity
impersonate=true
password=sample
userName=SampleUser/>

As we have enabled Impersonate this user will be used to execute the application. If I would have not mentioned any of the user than NT AUTHORITY\IUSR account would have been used. After messing things more around I checked that this User doesn’t has access to the folder.

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files.

So as soon as I gave permission to the User. The issue was resolved successfully. Sometimes things are simple that mess our whole day. Happy Learning.

2 thoughts on “Couldn’t load assembly Antlr2.Runtime access denied

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.