Since installing VS 2012, I get an intermittent PlatformNotSupportedException

I recently installed VS 2012 and .net Framework 4.5, and everything is basically fine, except that I sometimes get an error: This operation requires IIS pipeline integrated mode.

Of course, I have a managed route mode: integrated in IIS.

protected override void OnLoad(EventArgs e) { var st = new StackTrace(true); string message = String.Format("Redirect to url: {0}, Stack Trace:\r\n{1}", url, st); Trace.TraceInformation(message); } protected void Application_Start(Object sender, EventArgs e) { Trace.Listeners.Add(new OurAspTraceListener(Context)); } 

And the custom trace listener is pretty simple.

 private class OurAspTraceListener : TraceListener { private readonly HttpContext _context; public OurAspTraceListener(HttpContext context) { _context = context; _context.Trace.IsEnabled = true; } public override void Write(string message) { _context.Trace.Write(message); // it throwing here. } public override void WriteLine(string message) { _context.Trace.Write(message); } } 

This is really weird because if I just delete the update, it continues without any problems.

Any help would be appreciated, thanks.

+4
source share
1 answer

What version of IIS do you have? If you are using IIS 7, make sure that the application pool type is set to integrated rather than classic. The integrated pipeline mode is specific to IIS 7.

0
source

All Articles