jloper
jloper

Reputation: 49

How to create an Empty web project (no C#, no MVC, no .Net References) in Visual Studio 2017

I need a web project that can be deployed to a web server (in this case IIS), however I do not want anything other than static HTML, TEXT and JSON files in the project. I don't want to do a build. I don't want a Properties folder. I don't want a BIN folder. I don't want an OBJ folder. I don't want any NUGET packages. Most of all, I don't want any DLL or .Net references.

I have tried the solution proposed by Microsoft here: https://social.msdn.microsoft.com/Forums/vstudio/en-US/7589fbbf-732d-4c99-b9e9-7fe247f18f5a/how-to-create-static-web-site?forum=visualstudiogeneral

This is not even close to a static site.

And, here: https://marketplace.visualstudio.com/items?itemName=MadsKristensen.ASPNETCoreTemplatePack20173 I found an updated template which says it will create a static site without C#. It does not. Roslyn is included as is .Net CORE. Also at least 1 C# file is still generated and is still needed.

I tried going back to Visual Studio 2015 to see if there was an option there, which I could then just reopen in VS 2017, but I found none there either.

Anyone know how to create a truly empty web project for VS 2017, which can be published, but has only static content?

Upvotes: 1

Views: 1842

Answers (1)

jloper
jloper

Reputation: 49

The solution suggested, that of using a Blank solution, really does not offer a solution at all. The blank solution still has no projects, and adding a project pulls in all the ASP.NET and/or MVC pieces I am trying to ignore.

I did find that I can use 'File->Open Website', browse to a folder with the static content and open the web site in Visual Studio. Once I have altered the content as desired, I have to use 'Website->Copy Web Site' to copy the files to the IIS server. A packaged deployment is not available. The 'Copy Web Site' indicate which files have changed so it is pretty easy to figure out what files need to be updated. To copy one or more files, use the connection buttons at the top of the dialog, then select files as necessary on the left and use the arrows in the middle of the dialog to move/copy files to the IIS server on the right.

Image of Copy Dialog

The result is a project I can open and edit in Visual Studio, which can be easily deployed/updated from inside Visual Studio. I tried the solution in VS 2015 and VS 2017.

Upvotes: 2

Related Questions