Thursday, April 28, 2016

Visual Studio 2015 MVC Project Template Access Denied

Leave a Comment

I've created a very simple MVC application in VS2015 which has some basic CSS styling and some HTML to get an application off the ground more quickly.

The application runs perfectly.

I've exported this as a template using File -> Export Template...

I then created a brand new project based off this project type. So far so good. But, now when I run the newly created project I get a blank page with "Access Denied" (see image).

I've been going over the template project and the new project with a fine tooth comb and I can't find any differences. Why would one work but the other give an access denied? I am out of ideas, any help is appreciated.

Access Denied

EDIT:

After more research I have found the cause of the problem, but not a solution.

It seems that the project template has "Anonymous Authentication" as Disabled, and has "Windows Authentication" set to Enabled in the project settings. However when I create a project based on the template these values are flipped and thus causes the Access Denied.

Here's an image of the project settings in the template:

enter image description here

Here's an image of the project settings in the "new" project:

enter image description here

Note that both Authentication settings are flipped. Can anyone tell me how to get this to not happen?

Edit 2:

As suggested, the applicationhost.config files are different which is causing the above problem. Here is the applicationhost.config security section of the Template:

enter image description here

However, here is the same file in the new project created based off the template:

enter image description here

Notice that the section is missing entirely from the new project. So, now the question becomes how do you get this to copy over to new projects?

1 Answers

Answers 1

have you had a look at the global routes? it could be something routes not created or corrupted?

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment