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 ?
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
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/