How to create non .NET core web API? - visual-studio

We need to create a web API project from Visual Studio 2017, however, it seems the only option is to create .NET Core version of it. Any idea on how to create traditional web API?
I tried going through create project scenarios, but the web api option is not available.
Here is the screnshot:

Step 1 - GoTo to Visual Studio Installer -> 'Select your Version' -> Click 'Modify'
Ref - https://www.screencast.com/t/3AAGkmSPG4S
Step 2 - Under Individual Components Tab -> Check required development tools as your wish and modify
Ref - https://www.screencast.com/t/ZJAe4HUc90V
Step 3 - Create a new application as shown in in figure -> select WebAPI on next step
Ref - https://www.screencast.com/t/IIMsnPcWUxu

Related

Can't select .NET Core as framework for Service Fabric Application

When I create a new Service Fabric Application in Visual Studio 2019 (i.e. the project containing the .sfproj file, not an individual service), I can't select .NET Core as the framework for the project. I only get to choose between different versions of .NET Framework. Is this expected or does it have anything to do with my setup? I've migrated all the other projects in the service fabric solution to .NET Core, but I can't migrate the .sfproj project. Although not a huge problem, it would be nice to get rid of .NET Framework entirely.
Steps to reproduce: File > New > Project > Search for and select "Service Fabric Application" > Next
As JayMee points out in the comments, the first selection is for the fabric application and the subsequent selection is for the fabric service. These create two projects in your solution, using sfproj and csproj files, respectively. I chose .NET Framework 4.8 for my app and .NET Core 3.1 for my service.
Note that even though it's called a "service", it is also an application, complete with Program.cs, hence netcoreapp3.1 instead of something like netstandard for a library (this surprised me).
Note also that currently (VS 16.11.2) the app project sfproj file it creates is an old Framework style project file, not a new SDK style project file.

Visual studio enterprise 2017 targeting

When I am creating a project I am missing the targeting framework selection. This is how my installer looks
But still can't select the target framework. Any pointers?
This is expected, it will sort of default you to latest to help you stay current. After creation, you can go into the properties to switch the target framework type. Depending on the type of framework you'd want to use, it is important to select from the "Windows Classic Desktop" and the "Web Previous Versions" project categories, the different flavors of .NET 3 and 4 are only available through these project categories, when you select one of these project types you should also see the Framework Version selector at the bottom of the Creation window:
For the .NET Standard and .NET Core you switch them after creation.

Creating web application using VS 2015 Update 3 creates with references 1.0.0-rc2-final

Creating a web application as ASP.NET Core Web Applicaiton (.NET Framework) creates with most of the references as 1.0.0-rc2-final.
I am using the RTM version of VS 2015 Update 3. Hoping the references to be full version rather than rc2-final.
Are the templates updated properly? Do I need an update for the tools? If needed, where will I get it?
Thanks
ASP.Net Core tooling isn't included in Update 3 so apart from Update 3 you also need to install Web tooling. Go to: https://www.microsoft.com/net/download and download ".NET Core Tooling Preview 2 for Visual Studio 2015" (at the bottom of the page).
Probably going to have to update the project with nuget or by hand this assumes you have installed the SDK Core Preview2 Tooling located here.
NET Core 1.0 for Visual Studio
NB: while the framework has RTM'd the tooling is still in preview status since they are still working on it, hence Preview2 status.
if you have a Global.json file I would also suggest clearing out the entry that says "sdk": {}

Open an exising MVC 3 project in visual studio 11 developer preview

I've trying to open and convert an existing vs 2010 mvc 3 project in the new dev 11 preview and am running in to a difficult issue. The solution file will convert successfully, however the one mvc 3 web project in the solution shows in the solution explorer as unloaded post conversion. When i attempt to reload the project from solution explorer, i get prompted to convert the project and receive the following error in the upgradelog.xml
The project file'myproject.csproj' cannot be opened. There is a missing project subtype. Subtype: '{E53F8FEA-EAE0-44A6-8774-FFD645390401}' is unsupported by this installation.
From what i could track down, this has to do with MVC, but that doesn't really help me work around the issue. Any suggestions or workarounds would be appreciated.
Update: Actually, MVC 3 for Visual Studio 11 Dev Preview has just been published: http://www.microsoft.com/download/en/details.aspx?id=1491
We have not yet shipped MVC 3 support in Visual Studio 11. You can work around this by editing your csproj file and removing the project type GUID {E53F8FEA-EAE0-44A6-8774-FFD645390401}. This will cause your project to load like a normal WAP. You will be able to edit your code, however MVC-specific actions (Add Controller, etc) will not be available.
You may want to try the steps from the Upgrading an ASP.NET MVC 3 Project to ASP.NET MVC 4 section of the release notes, even if the document describes the VS2010 version.
I managed to convert a VS2010/MVC3 project, but VS11 shows a warning every time I open the solution, stating that the project requires ASP.NET Web pages with Razor syntx 1.0. OTOH, the project seems to run without any problems (VS11 setup also installed ASP.NET Web pages 2).

VS 2010 Web Service project template missing?

This may be a silly question, but I can't find the web service application template when I try to create a new project.
You propably want a WCF Service Project: New Project -> Visual C# (or Visual Basic) -> WCF Service Application.
I've just struggled with this one myself.
It's still there buried in specific options.
New Project -> Visual C# (or VB) -> Web (important)
Make sure the .NET Framework Filter is set to 3.5 or lower
The project template is called ASP.Net Web Service Application
Counter intuitively it doesn't show up if you select the broader menu: New Project -> Visual C#
Do a full install on ultimate; it is still there.

Resources