59

We are developing a REST based application using Visual Studio 2010, using asp.net web api and we want to host it using IIS.

For the client side, we want to use pure html, css and javascript to access and using this REST based application.

But we could not find any project type HTML web application or site in VS 2010. WE do not want to use asp.net or mvc empty project.

Is there is any project type available or any other best way to do this?

Kyle Trauberman
  • 25,414
  • 13
  • 85
  • 121
daljit
  • 1,256
  • 1
  • 11
  • 30

2 Answers2

109

Create a folder on your drive for the website. Then create an Blank Solution project (Other Project Types -> Visual Studio Solutions). Finally, right click in your solution and choose "Add -> Existing website", select file system in the Add Existing Web Site dialog, and navigate to your web site folder.

BlackSpy
  • 5,563
  • 5
  • 29
  • 38
  • 4
    -1 although this works, it recommends using web sites, which, imho, is doing the readers a disservice. – John Saunders May 22 '13 at 03:44
  • 8
    Thats what he asked for though – BlackSpy May 27 '13 at 13:34
  • 1
    @JohnSaunders If not a web site, how would you recommend doing it? – vossad01 Apr 17 '14 at 15:48
  • @vossad01: Using a web application project. – John Saunders Apr 17 '14 at 16:07
  • 2
    @JohnSaunders John, could you elaborate that as an answer? I need a lot of things that Web Applications provide, but I only need it for simple html files also. I tried creating an empty web application but I failed to configure it to _not_ generate a compiled dll, for instance. Ideally, I'd like to avoid even creating a `bin` folder, since I have nothing that can be compiled on the project (I even removed the `AssemblyInfo` file and removed the `Properties` folder by editing the csproj file). – julealgon Nov 13 '14 at 17:42
  • @julealgon: that would be an answer to a different question. – John Saunders Nov 13 '14 at 17:58
  • @JohnSaunders [There you go](http://stackoverflow.com/questions/26916313/how-do-i-configure-a-web-application-project-for-working-with-html-pages-without) – julealgon Nov 13 '14 at 18:55
  • why not try creating empty template for html website as mentioned [here](https://pradnyanaik.wordpress.com/2011/02/03/web-development-in-html5-using-visual-studio-2010/) – Shaiju T Apr 24 '15 at 18:57
  • One issue with this approach appears to be that your static files are not published alongside your ASP.NET Web Api project like if you placed the files directly inside it. – Zero3 Apr 28 '16 at 12:35
5

I made a simple template. to get it:
Visit Visual Studio Gallery page. Download the VSIX file and install it. next time when you create new project, you will see the HTMLProjectTemplate in Visual C# project type.

Another way to install the plugin:
Install directly from VS2010 > Tools > Extension Manager, search for HTMLWebsite in Online Gallery, install it. next time when you create new project, you will see the template under Visual C# project type.

yantaq
  • 3,968
  • 2
  • 33
  • 34