ASP.net impersonation works on published intranet site but not localhost

2

So, I have developed a web application in VS 2010 using ASP.net with VB.net code-behind. This web app is hosted on the company server. I use impersonation in IIS to be able to access network files in my web app, but for some reason I have run in to problems. A few months ago, everythingin my program worked fine. However, I opened it today and got an error message:

ASP.NET runtime error: Could not load file or assembly 'Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0x80070542)

Now, this error prevents me from even running the program in debug mode. HOWEVER, it's important to know that the published version of the program, which is almsost the same, has no problems and it still working well. We recently changed the password of the account being used to impersonate, but I have updated that in the config file for the project.

My main concern is that it is working on the published website but not on localhost. Any tips? Thank you!

asp.net
.net
visual-studio-2010
impersonation
intranet
asked on Stack Overflow May 5, 2015 by Jack

1 Answer

2

I resolved the issue. I did this by simply disabling impersonation in my ASP.net project. For some reason, everything works fine without it now, so I am just not going to use it unless problems arise.

answered on Stack Overflow May 5, 2015 by Jack

User contributions licensed under CC BY-SA 3.0