Question

I have a Web forms application that runs fine in Visual Studio 2012 but when I run int in VS 2013 I get

System.SystemException occurred
Message: A first chance exception of type 'System.SystemException' occurred in mscorlib.dll
Additional information: The trust relationship between the primary domain and the trusted domain failed.

for a stacktrace when loading up the inital page. I am not sure where to start in trying to figure out what is causing the issue. Its running on the same framework version and has the same web config

Update .... I switch Visual Studio 2012 to use IIS Express and now get the same exception in VS 2012 and VS 2013. Now to resolve the exception ?

Any idea ?

Was it helpful?

Solution

This is because 2013 does not use cassini web server but instead uses IIS Express. This can happen in Visual Studio 2012 as well if you enable IIS Express instead of Cassini. To fix this follow these steps:

In visual studio click on your web project and then press F4

1) Anonymous Authentication needs to be disabled

2) Windows Authentication needs to be enabled

enter image description here

Note: if one of these are grayed out that means that you have a override in your IIS Express Config file which is located

\My Documents\IISExpress\config\applicationhost.config

Check for

 <section name="anonymousAuthentication" overrideModeDefault="Allow"/>

or

<section name="windowsAuthentication" overrideModeDefault="Allow" />

More information:

http://msdn.microsoft.com/en-us/magazine/hh288080.aspx

http://www.codegorilla.com/2012/12/how-to-enable-windows-authentication-when-using-iisexpress/

OTHER TIPS

From the error I'm making the assumption that you are using windows authentication..

You can get this error if you are calling isInRole and pass a role that doesn't exist..

HttpContext.Current.User.IsInRole("SomeMadeUpRole");

With regards to the difference between running in 2012 and 2013, 2013 uses IIS Express which is basically a cut down IIS 7.5 instead of 7...

Not 100% sure on this though, would be glad to hear if this helps!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top