VS2012 Development Server Settings

Lotok

Well-known member
Joined
Jan 17, 2012
Messages
198
Location
Scotland
Programming Experience
5-10
I have a couple of issues with the VS2012 development server. It seems to show as .NET 2, when the application I am writing is .NET 3.5. Now i know 3.5 is an addon to 2 however pretty sure it should show as 3.5.
The other problem is application permissions. I am building an intranet tool for our helpdesk which queries AD. To do so I need to use the HostingEnvironment.Impersonate method. On IIS this works no problem, but on the development environment i get the below error which seems like it is ignoring the security level in web.config.

It just makes debugging a pain in the behind as when I step into pages with the custom control I get these errors. To test I need to load onto IIS. Any ideas on how to resolve this one?


Cheers

[h=1]Server Error in '/Helpdesk' Application.
[/h][h=2]Security Exception[/h][FONT=Arial, Helvetica, Geneva, SunSans-Regular, sans-serif]Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.] System.Reflection.Assembly._GetType(String name, Boolean throwOnError, Boolean ignoreCase) +0 System.Web.UI.NamespaceTagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs, Boolean throwOnError) +98 System.Web.UI.NamespaceTagNameToTypeMapper.System.Web.UI.ITagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs) +11 System.Web.UI.TagPrefixTagNameToTypeMapper.System.Web.UI.ITagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs) +127 System.Web.UI.MainTagNameToTypeMapper.GetControlType2(String tagName, IDictionary attribs, Boolean fAllowHtmlTags) +228 System.Web.UI.MainTagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs, Boolean fAllowHtmlTags) +28 System.Web.UI.RootBuilder.GetChildControlType(String tagName, IDictionary attribs) +20 System.Web.UI.ControlBuilder.CreateChildBuilder(String filter, String tagName, IDictionary attribs, TemplateParser parser, ControlBuilder parentBuilder, String id, Int32 line, VirtualPath virtualPath, Type& childType, Boolean defaultProperty) +69 System.Web.UI.TemplateParser.ProcessBeginTag(Match match, String inputText) +526 System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) +926


Version Information: Microsoft .NET Framework Version:2.0.50727.5456; ASP.NET Version:2.0.50727.5459 [/FONT]
 
I don't know whether it will in this case but I would suggest installing IIS Express and using that for development as it overcomes some of the limitations of the inbuilt development server.
 
I don't know whether it will in this case but I would suggest installing IIS Express and using that for development as it overcomes some of the limitations of the inbuilt development server.


I enabled IIS components on my Development Machine (Win 7 Pro 64x)
Set up the application pool & default directory
Checked on browser and IIS holding page shows.

Yet, cannot debug to it. If I move debugging server to IIS7
I get: Unable to start debugging on web server. The web server could not find the requested resource.

MSDN helpfully says this is a generic error and could be caused by many things...great!

Cheers for idea of moving away from VS development server though, pretty sure getting this working is worth the effort to get passed the quirks.
 
I don't know whether it will in this case but I would suggest installing IIS Express and using that for development as it overcomes some of the limitations of the inbuilt development server.
what's new said:
In Visual Studio 2012, IIS Express is the default server for web development.
Whether that is version 7.5 or 8.0 I don't know.
 
I moved it to the local IIS on my Windows 7 machine, so under debug menu and [project] properties, start options, set the server to use custom server and pointed it to localhost
I do have a development server too running Windows 2008 server with IIS but, having just as much bother playing with remote debugging. I think it will be simpler to try and get it working on local.

The version of IIS that comes with windows 7 should be 7.5 I think.
 
Whether that is version 7.5 or 8.0 I don't know.

It is true that IIS Express is the default but the alternative is Visual Studio Development Server and the OP specifically said:
I have a couple of issues with the VS2012 development server.
so it's not clear exactly what the web server that was causing issues was.
 
Just to clarify. My understanding was < VS2010 was cassini and VS2012 is IIS Express
I hadnt changed the development server away from IIS.

I have now changed it to local but it doesn't work. is there anything specific you know of to set up on the local IIS to allow debugging other than ofcourse setting it under custom server in VS?

Cheers

[edit]
There is a checkbox in settings allowing you to disable the use of IIS. I hadnt used that, so IIS was/is still active.
 
Last edited:
Back
Top