Web API Project Template is missing from the "Add new project" dialog - asp.net-web-api

I've encountered an issue regarding the Empty "ASP.NET Web API Project Template" extension (downloaded from here: https://visualstudiogallery.msdn.microsoft.com/a989a149-4bc3-4292-ac8a-5101ee1722d7
After I installed it, (with all instances of VS closed) I couldn't see it anywhere in the new project console:
As you can see, it's not present (although I know for sure it supposed to be there since I have it at work.
Furthermore, I can see it in the "Extensions and Update" menu:
And it is enabled.
I just don't understand what I did wrong.
Any help will be highly appreciated.
Thnx

You can find Web Api after u choose MVC 4 Web Application
1- Choose Asp.net MVC 4 web application
2- from the inner window choose Web Api

Related

How do I set a default static page for a ASP.Net Core Web API Project when start debug in VS2015?

I'm using VS 2015 and have a ASP.Net Core 1.1 Web API Project.
If I start debug it will launch Edge with the following url: http://localhost:XXXXX/api/values
I have since long removed this controller but it still tries to find it.
I have read the docs and made the appropriate changes to be able to show a static file.
In my wwwroot folder i have a Index.html file.
If i manually navigates to http://localhost:XXXXX the file is displayed.
My question is: How can I make VS2015 show my Index page when I start debugging.
I found the option when right clicking the project and selecting properties. Then under the tab Debug, enabled Launch URL and entered the value.
Edit Properties/launchSettings.json - it stores launch url which VS use.

Missing Scaffolding Options in ASP.NET MVC 3 Add Controller Dialog

I have downloaded and installed the release version of ASP.NET MVC 3 (File version: 1.13.113.0), Created a new project of type ASP.NET MVC 3 web application.
When I right click on Controllers folder=>Add Controller, The Add Controller dialog doesn't have any scaffolding option. It just contains a textbox for Controller name and a checkbox to add action methods for CRUD scenarios.
should I do anything to view the Scaffolding options (Template, Model Class, Data Context Class and View) in Add controller dialog box?
In the Web Platform Installer 3.0 you can find something called "ASP.NET MVC 3 Tools Update"
Install that one and you get the Scaffolding options and some other stuff.
Yes agreed it takes forever to install via web platform installer. Use link http://www.microsoft.com/download/en/details.aspx?id=1491 to download and install.
Make sure you have the lastest with the tool update.
http://www.asp.net/mvc
ASP.NET MVC 3 Tools Update can take a while, but it fixed it for me.
If you tell Web Platform Installer to update Visual Studio it will take basically forever, I had to force shutdown and try again just doing MVC 3.
Thanks Beijer.

Is my Visual Studio project a web application or a web site?

First of all, when to use what and the overall differences between them has already been answered before. But I couldn't find an answer to this question:
Where can I check if my Visual Studio project is a Web Application or a Web Site?
The easiest way to differentiate between Web Site and Web Application is to look at the project's icons.
Web Site
has an icon without the used language
displays its physical root path
does not have a Properties folder
Web Application
has an icon including the used language
displays the project's name
has a Properties folder
To find out more about the technical differences between them ...
ASP.NET Web Site or ASP.NET Web Application?
Personally, one tell tale sign for me is whether the project folder actually contains a project file, or not.
You can see the icons differ slightly in VS - a web application has a layered world->docs->language icon and a web site just consists of world->docs.
Also, once opened within VS, right-clicking will display Properties and Property Pages for web applications and web sites respectively; further, on clicking this option you will be greeted with a dialog for the former and MDI tabbed form for the latter - the latter also exposes more functionality to control pre and post build steps and so forth.
A a web application will also display Properties and References special folders as part of the project tree in the Solution Explorer, whereas a web site does not necessarily; unless manually created for some reason (but they still won't be special - web sites use the bin folder for their references).
I recently found out (painfully) that web applications do not support Profiles which is not fun. Web sites however do support them and make life much easier. I noticed here people saying there are no major differences. This one is quite major and can make your life difficult if you select to make a web application instead of a web site.
Web application and Web Site are VS templates, nothing more. I doubt you will find this information directly somewhere in project. You can try to go through template differences list and guess how this particular project was created.
For Web Site project, once run (F5) you can change the code in the code-behind, the solution will allow it and it will compile on the fly when saved.
A Web Application project, however, will not allow this. This is the simplest way of being able to tell between the two.

Why does the default ASP.NET MVC 3 project not use controllers?

Upon creating a new ASP.NET MVC 3 Razor site, there are 9 Account\*.cshtml files which seem to be views with the controller logic inserted at the top of the view in an anonymous code block. There is no account controller class.
Why is this? As I understood, the benefit of MVC was the separation of concerns of code & presentation. Does this imply that I should remove all of the existing files & re-implement the Authentication & Authorisation layers?
It seems odd that MS would ship the 'worst possible example' with their flagship web framework.
Thanks,
Jarrod
Edit: I was using the wrong entry point within visual studio to create the application (see my comment below). Thanks!
Hmm, something is not quite right on your end.
I just created a new ASP.NET MVC3 Web Application.
I do have a 'Controllers' folder with a proper AccountController as part of the project.
Are you using Visual Studio?
This is incorrect. Here's the default folder structure in the MVC3 Razor starter app:
As you can see, there are two controllers in the ~/Controllers folder.
Just to be clear, I started a new VS2010 instance, created a new MVC3 project, selected "Internet Application" and Razor as the view engine.

How do I go about adding a website to Silverlight

Say I had (foolishly) setup a Silverlight project in VS and failed to setup a supporting website at time of instantiation are there any steps I can take to add one retrospectively?
Many thanks.
Do the following:-
Add a new Web Application or Web Site to the existing solution.
Open the properties of the new Web Application, on the Silverlight tab select Add..., select the existing SL project in the project drop-down (already selected by default), Click Add.
Set the web app to be the startup project
Select the newly created test .aspx page that will have been created for you as the start page.
Now you are where you would have been had you opted to create the test web app when creating the solution.
The simplest solution might be to create a new solution with the supporting website project and copy your Silverlight project into that and carry on working in the new solution.
You could also copy the web project to your existing solution. In that case you'll need to change the name of the referenced .xap file.

Resources