How do I restore a missing project template in Visual Studio 2015? - templates

Since installing the latest ASP.NET and .NET Core in Visual Studio 2015, when opening a project created with the "Class Library (Package)" template, the project shows in my solution as "(incompatible)".
What happened to the template that creates project files with the *.xproj extension?
How do I open previously created projects with this extension?

"Class Library (Package)" is a template for Asp.NET 5 project which use DNX while the latest Asp.Net Core use .Net Core. You can following the instruction here to upgrade the Asp.NET 5 project to Asp.NET Core project: Migrating from ASP.NET 5 RC1 to ASP.NET Core 1.0.

Related

Nunit tests not running after upgrading from .NET Framework to .NET 5

I just upgraded a project from .NET Framework 4.7.2 to .NET 5.0, and now when I open Test Explorer and try to run my NUnit unit tests, they silently do nothing - can't find any logging info either. My environment:
Visual Studio Pro 2019 16.11.7
NUnit 3 Test Adapter (v. 3.17.0) extension installed
NUnit (v. 3.13.1) nuget package installed in the relevant test project
TFM for the test project and lib to be tested are both net5.0-windows
Thanks for any pointers.
You are missing Microsoft.NET.Test.Sdk NuGet package.

visual studio 2017 .NET SDK does not support targeting .NET Core 2.0

I am breaking my head over this for a while now:
I have tried installing both professional and community version of visual studio 2017 v 15.5.2
and installed .net core Runtime 2.0.3 and .net core SDK 2.1.2.
When I open a new web application I get an error saying
"the sdk 'microsoft.net.sdk.web' specified could not be found"
When I try to build an existing project I get an error
"the current .NET SDK does not support targeting .NET Core 2.0. Either
target .NET Core 1.1 or lower, or use a version of the .NET SDK that
supports .NET Core 2.0."
I don't see ".net core 2.0" in my target framework
I don't have global.json file in my computer
When I try dotnet --info, I get this
.NET Command Line Tools (2.1.2)
Product Information:
Version: 2.1.2
Commit SHA-1 hash: 5695315371
Runtime Environment:
OS Name: Windows
OS Version: 10.0.10586
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.2\
Microsoft .NET Core Shared Framework Host
Version : 2.0.3
Build : a9190d4a75f4a982ae4b4fa8d1a24526566c69df
Some one please help
Fixed it by adding a MSBuildSdksPath userVariable.
Add an Enviroment variable named MSBuildSdksPath.
It's value should point to a Dotnet SDK folder. Eg:
C:\Program Files\dotnet\sdk\2.2.102\Sdks

Publish .net Core web app as Web Deploy Package (MSDeploy) fails in Visual Studio 2017

I have created multiple sample project following the VS2017 .Net Core Web App template, targeting .Net Core and .NET Framework.
I have tested in all last three cumulative updates of VS2017; (i.e. Version 15.3.2, 15.3.3, 15.3.4)
Publishing to Web Deploy Package fails with the following error:
Target: .NET Core
Web deployment task failed. (Could not find file '\PublishTestNetCore.Parameters.xml'.) PublishTestNetCore C:\Program Files\dotnet\sdk\1.1.0\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeployPackage.targets 88
Target: .NET Framework 461
Web deployment task failed. (Could not find file '\TestPublish461.Parameters.xml'.) TestPublish461 C:\Program Files\dotnet\sdk\1.1.0\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeployPackage.targets 88
I am able to publish to IIS server though, but building the MSDeploy package always fail.
Thanks for any hint.
Mamrez
The issue was that the publish to package with latest VS 2017 cumulative updates required .NET Core 2.0 installed and that's odd!
I had to follow this link to install .NET Core 2.0 on my developer laptop to be able to publish MSDeploy packages that target non-.NET Core 2.0!!
[https://www.microsoft.com/net/core#windowscmd]

visual studio mac for mac missing of identity class

Hi i downloaded visual studio for mac 2017 community version. I created a default MVC Core 2.0 project and i noticed that there is missing class of Account controllers where it used to have register and account other handler functions.
i created the same project in windows .In windows i can see that there is identity class and controller created.
how do i generate this authentication class in visual studio for mac Core 2.0?
I tried creating the default project in windows and copy to mac and it works!!! After i change the connection string to the server.Identity framework works fine in mac. But why is microsoft not generating the code for mac?
ok this is the command to include authentication for mac ok visual studio 2017 core 2.0.
dotnet new mvc -o moviemvc --auth Individual
once u register a new account. it will create a new database in the folder with app.db which is filebase database i believe.
open db use this sql lite browser to open it and view the content of it.
if you want to use sql server instead then you will need to add this into the line when create new project with terminal. add it in front of --auth will do
-uld
With Visual Studio on Windows there are extra options you can configure when creating a new ASP.NET Core project. These extra configuration options are not currently available with Visual Studio for Mac so a simpler ASP.NET Core project is created.
So you are left with copying the project from Windows, as you already did, or you can open a command prompt and use dotnet new to create a project. If you run the following you can see what configuration options you can specify for the ASP.NET Core MVC project template:
dotnet new mvc --help
Currently the GUI for Mac Visual Studio does not support the ability to add Authentication. However, the CLI does!
dotnet new sln --name <filename>
This will create a new sln
If you don't use the --name flag the sln will take the current folder's name
dotnet new mvc -o moviemvc --auth Individual
This will create a new .csproj with mvc and Authentication (Identity models) included
dotnet sln add </filepath>
This will add the file to the sln in the folder (if exists)
dotnet sln <path-to-solution.sln> add <path-to-project.csproj>
If you have multiple sln's in the folder, you will have to specify the sln you want to target
You can find more information here too

Associate Azure WebJobs in Visual Studio 2013

In the Windows Azure build keynote (2014-04-03) they demo Azure WebJobs. You can clearly see how they associate the current WebJob with the ASP.Net website application. However, I don't have this option available in Visual Studio 2013. Does it come with the new Web Features in Visual Studio 2013 Update 2 RC? I haven't installed it (still RC...) but it's clearly not in the release notes. I've installed the latest Windows Azure SDK for .NET (VS 2013) - 2.3.
In the video you can see the association in action:
Update:
After installing Visual Studio 2013 Update 2 RC I still don't see the option
Just found this awesome extension that I was looking for:
With this extension you can right click on a web project in Visual Studio and associate a console project as a WebJob. After doing that when you publish the web project the webjob project will be published into the correct location in your Azure Web Site
http://visualstudiogallery.msdn.microsoft.com/f4824551-2660-4afa-aba1-1fcc1673c3d0