mathis1337
mathis1337

Reputation: 1619

Brand new MVC Asp.Net Project Loads default page, but 403 after for anything else

I created an ASP.Net MVC project and when I deploy and publish this project the default page will load and appear to work fine, however, if I try to leave to any other URL I get a 403 error. I checked IIS event logs and found this anytime I click a link.

> Event code: 3005  Event message: An unhandled exception has occurred. 
> Event time: 5/16/2017 1:46:04 PM  Event time (UTC): 5/16/2017 6:46:04
> PM  Event ID: 9d8a7e9c041b462c9915b24fd7f941db  Event sequence: 8 
> Event occurrence: 2  Event detail code: 0    Application information: 
>     Application domain: /LM/W3SVC/7/ROOT/test/CC-6-131394337509150873 
>     Trust level: Full 
>     Application Virtual Path: /test/CC 
>     Application Path: D:\zrodelta\dev\test\CC\ 
>     Machine name: JBISVR4    Process information: 
>     Process ID: 156 
>     Process name: w3wp.exe 
>     Account name: IIS APPPOOL\CreditCard    Exception information: 
>     Exception type: HttpException 
>     Exception message: Server cannot append header after HTTP headers have been sent.    at System.Web.HttpResponse.AppendHeader(String
> name, String value)    at
> System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase
> httpContext, IController& controller, IControllerFactory& factory)   
> at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase
> httpContext, AsyncCallback callback, Object state)    at
> System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
> at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
> Boolean& completedSynchronously)
> 
>     Request information: 
>     Request URL: https://zrodelta.com:443/test/CC/Home/About 
>     Request path: /test/CC/Home/About 
>     User host address: 192.168.125.57 
>     User:  
>     Is authenticated: False 
>     Authentication Type:  
>     Thread account name: IIS APPPOOL\CreditCard    Thread information: 
>     Thread ID: 38 
>     Thread account name: IIS APPPOOL\CreditCard 
>     Is impersonating: False 
>     Stack trace:    at System.Web.HttpResponse.AppendHeader(String name, String value)    at
> System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase
> httpContext, IController& controller, IControllerFactory& factory)   
> at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase
> httpContext, AsyncCallback callback, Object state)    at
> System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
> at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
> Boolean& completedSynchronously)
>     Custom event details:

I have not changed any of the defaults and I left everything as the template created. I used Web deploy and everything appears to work. I have heard it has something to do with my routing, or possibly something to do with headers. But I can completely lost.

Error Image

Page Load

Any help would be greatly appreciated as I am stuck. I have followed most normal steps like assuring permissions, checking framework versions, etc. I feel it is either something in my code, or something I missing on the server, whatever it is, I am sure its a small setting that i need to change, I just don't know what it is. The project is an ASp.Net 4.5.2 project by the way.

After creating new project with no authentication. This still shows up in Event Viewer as the problem:

Event code: 3005 Event message: An unhandled exception has occurred. Event time: 5/16/2017 2:49:10 PM Event time (UTC): 5/16/2017 7:49:10 PM Event ID: a21d9a3b87f34c8090c7b1e36394c85b Event sequence: 14 Event occurrence: 1 Event detail code: 0 Application information: Application domain: /LM/W3SVC/7/ROOT/test/CC-3-131394377202796591 Trust level: Full Application Virtual Path: /test/CC Application Path: D:\zrodelta\dev\test\CC\ Machine name: JBISVR4 Process information: Process ID: 1312 Process name: w3wp.exe Account name: IIS APPPOOL\ASP.NET v4.0 Exception information: Exception type: HttpException Exception message: Server cannot append header after HTTP headers have been sent. at System.Web.HttpResponse.AppendHeader(String name, String value) at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory)
at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Request information: 
Request URL: https://zrodelta.com:443/test/CC/Home/About 
Request path: /test/CC/Home/About 
User host address: 192.168.125.57 
User:  
Is authenticated: False 
Authentication Type:  
Thread account name: IIS APPPOOL\ASP.NET v4.0    Thread information: 
Thread ID: 12 
Thread account name: IIS APPPOOL\ASP.NET v4.0 
Is impersonating: False 
Stack trace:    at System.Web.HttpResponse.AppendHeader(String name, String value)    at

System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory)
at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) Custom event details:

Upvotes: 0

Views: 214

Answers (1)

mathis1337
mathis1337

Reputation: 1619

So I finally figured out the issue. With all the solutions online nothing worked, and I finally figured out that it was due to the fact I wanted to hose this site in the same location as a Wordpress site. I did not know this, but Wordpress for SEO friendly URL's has a URL Rewrite function. I added my new folder to an exclusion rule and bam, it all worked. Thanks for the help!

Upvotes: 1

Related Questions