0

I'm trying to use the latest .net tooling.

I've followed the links to install .NET core 1.0.1 and 1.0.0 SDK (as one) from the .NET Core landing page.

This installs the .NET Core SDK 1.0.1:

enter image description here

And if I navagate to the C:\Program Files\dotnet\sdk:

enter image description here

This only has the 1.0.1 .net core version:

enter image description here

EDIT: It seems an old install of the VS 2015 .NET Core tooling installed the old preview version and, interestingly, a x86 version in C:\Program Files (x86)\dotnet\sdk which I think is the version it's actually using:

enter image description here

And in the Microsoft.NETCore.App:

enter image description here

I can see the latest version installed, alongside an older version (I think this maybe came with VS 2015 update?).

However, when I try following the documentation I quickly find issues.

dotnet new webapi

results in Unrecognized command or argument 'webapi'. Creating a dotnet new creates a project.json instead of the .csproj I'm expecting.

dotnet --version reports: 1.0.0-preview2-003133

So it's using the older CLI tools. However, when I try to force the latest version with a global.json with the following in my empty new project directory:

{
"sdk": {
    "version": "1.0.1"
  }
}

I still get 1.0.0-preview2-003133 reported.

How can I use the latest tools?

Joe
  • 6,773
  • 2
  • 47
  • 81
  • Looks like something went wrong during the installation of the SDK 1.0.1. I have a similar setup with several SDKs installed, but after having installed SDK 1.0.1 it becomes the default one and if I type "dotnet --version" in cmd.exe (when not in a dotnet project folder) it definitively says 1.0.1. What do you have in here "C:\Program Files\dotnet\shared\Microsoft.NETCore.App" ? Can you see the associated runtimes LTS 1.0.4 and FTS 1.1.1? Could you consider uninstalling the previous SDK ? Repairing the new one? – Daboul Apr 10 '17 at 15:27
  • Added requested. I can see 1.0.1, 1.0.4 and 1.1.0 in the program files/shard/.NET Core App folder. Interestngly, there's a programfiles(x86) version which differs. I think this was installed as part of VS 2015 webtools back in october last year. – Joe Apr 10 '17 at 15:39
  • Managed to fix it by uninstalling the older tools. – Joe Apr 10 '17 at 15:50

3 Answers3

0

You need .net core 1.1 to get the csproj style projects, and that requires Visual Studio 2017 rather than 2015.

Iain Brown
  • 1,079
  • 3
  • 11
  • 23
  • I'm just trying to use the command line CLI, that requires no Visual Studio at all. The SDK also includes 1.1 (from the download page: .NET Core SDK (contains .NET Core 1.0 and 1.1)) – Joe Apr 10 '17 at 15:18
  • Ok, slightly confusing as you're talking about 1.0.1 in the question, not 1.1 – Iain Brown Apr 10 '17 at 15:20
  • 1
    You've downloaded the exe from the download page, not "NET Core tools Preview 2 for Visual Studio 2015"? From your version numbers it really sounds like you're using the 2015 tools. – Iain Brown Apr 10 '17 at 15:23
  • I think the issue is the 2015 tools were installed months ago, but I don't want to use them on a new project. I've installed the latest .NET tools from the download page, but it's defaulting to the old VS 2015 tools (which I now can't remove, because it requires the original EXE and you can't seem to download that) I thought 1.0.1 was the latest SDK tooling (I'm not sure a 1.1 exists? 1.0.1 was the one I downloaded, see the installer image) – Joe Apr 10 '17 at 15:33
  • Yeah, the old VS 2015 tools were indeed the problem, thaks for pointing me towards them. I assumed two versions of the CLI could co-exist (this seems to be the point of the global.json!) – Joe Apr 10 '17 at 15:51
0

Probably your project has not yet been migrated from project.json to *.csproj.

You can run dotnet migrate to migrate your project/solution to the new/old Csproj. the new Dotnet sdk only works with csproj files.

Joel Harkes
  • 10,975
  • 3
  • 46
  • 65
  • I don't have a project to migrate, I'm simply trying to create a new project using the latest CLI - but can't access the latest CLI – Joe Apr 10 '17 at 15:17
0

Okay, the problem was that the older VS 2015 tools seemed to be being prioratized over the newer installed tools. I managed to uninstall them using this.

Now 1.0.1 is the default CLI used and it's creating up to date apps.

Thanks for the help everyone in the comments and other answers who pointed me in the right direction.

Community
  • 1
  • 1
Joe
  • 6,773
  • 2
  • 47
  • 81