0

I'm building a website in VS2015 (C# using Razor) I see many posts where people say that they receive this error on their server, but not localhost - my issue is the opposite. I'm seeing this error in every *.ashx file preamble in this specific Website only while running Localhost on my development machine:

ASP.Net runtime error: Loading this assembly would produce a different grant set from other instances (Exception from: HRESULT 0x80131401)

This error prevents me from using Intellisense in the file - and I really need it for this next handler.

What I've Determined: - The issue is specific to this Website. I have other websites that do not produce this error, so there isn't a need to modify registry or change PC configurations.

What I've tried:

  • IISReset (Restart PC) [*before I realized problem was local]
  • Changing Registry by adding LoadingOptimizer DWORD [*before I realized problem was local]
  • Compared XML of a working Web.config file. (Other than assembly differences I played around with other differences and still nothing)

Any suggestions?

enter image description here

Sanya
  • 1,270
  • 5
  • 21
  • 47
  • Are you using full IIS on local and the Server, and not IIS Express on local? Check the Identity of the AppPool that is hosting the application - server may have something that localhost doesn't. – cost Aug 06 '19 at 15:52
  • Actually IIS Express on Both – Sanya Aug 06 '19 at 15:55
  • I'm starting to wonder if it has to do with the Build. I'm building .NET Framework 4.6.1. The working websites were built on 4.5.2. I wonder if some of the assemblies are not jiving with 4.6.1 – Sanya Aug 06 '19 at 15:58
  • Yes, you're trying two different things, that's never good for testing. – cost Aug 06 '19 at 16:07
  • My other (older) websites were built on 4.5.2. This new one is built on 4.6.1. – Sanya Aug 06 '19 at 16:25

0 Answers0