user3953989
user3953989

Reputation: 1941

Publish from VS 2017 doesn't include views/web.config which throws 500 error

As the title says, I publish my MVC/.Net 4.6.2 app to my Server 2012R2 server and it throws a 500 error. If I manually copy my Views/web.config everything works again.

Am I missing an option to get it to deploy?

Upvotes: 0

Views: 1518

Answers (1)

R. Richards
R. Richards

Reputation: 25161

In this situation you all you have to do is make sure that the Build Action for the web.config file is set to Content. I have found that sometimes files that you need don't get set like this automatically within Visual Studio.

To make this change, find the file in the Solution Explorer. Select the file. Then in the Properties pane, set the Build Action to Content by choosing Content form the dropdown next to the property label.

Glad this helped you out.

Upvotes: 3

Related Questions