2017-05-11 52 views
7
ile uyumlu değil.

Kısa bir süredir Visual Studio Mac kullanıyordum ve yeni sürümü piyasaya sürdüm. Ben oluşturmak ve kabuk o projeyi çalıştırabilirsinizVisual Studio Mac dotnet core 2

dotnet2 davec$ dotnet --version 
2.0.0-preview1-005977 
dotnet2 davec$ dotnet new webapi 
The template "ASP.NET Core Web API" was created successfully. 
This template contains technologies from parties other than Microsoft, see https://aka.ms/template-3pn for details. 

Processing post-creation actions... 
Running 'dotnet restore' on dotnet2/dotnet2.csproj... 
Restore succeeded. 

: Ben de yeni bir Web API projesi üretebilir bir kabuk isteminde NET Çekirdek 2.0 Önizleme 1. indirip yükledim. Ben Mac, IDE denemeden için Visual Studio açmak ve başarısız olduğunda Ama geri:

Errors in dotnet2/dotnet2.csproj 
    Unable to resolve 'Microsoft.NETCore.App (>= 2.0.0)' for '.NETCoreApp,Version=v2.0'. 
    Unable to resolve 'Microsoft.NETCore.App (>= 2.0.0)' for '.NETCoreApp,Version=v2.0 (win)'. 
    Unable to resolve 'Microsoft.NETCore.App (>= 2.0.0)' for '.NETCoreApp,Version=v2.0 (win-x64)'. 
    Unable to resolve 'Microsoft.NETCore.App (>= 2.0.0)' for '.NETCoreApp,Version=v2.0 (win-x86)'. 

NuGet Config files used: 
    ~/.config/NuGet/NuGet.Config 

Feeds used: 
    https://api.nuget.org/v3/index.json 
Restore failed for 'Microsoft.NETCore.App (>= 2.0.0)'. 
Restore failed. 
+4

https://gist.github.com/mrward/70b8132003ef77d893111ecbea3e2225#net-core-app-20-project – jmoerdyk

+0

Teşekkürler 'RuntimeFrameworkVersion' benim için sorunu çözdü. –

cevap

3

Bütünlük açısından, burada cevabı belgeleyen @ jmoerdyk en yorumları sonrasında:

My Çevre: MacOSX 10.12.4 dotnet sürümü: 2.0.0-preview1-005977

  1. Açık bir metin düzenleyicisinde csproj dosyası (vi TextEdit'i, VS Code)
  2. Hedef fra değiştirin mework ve RuntimeFrameworkVersion bu olması:

<Project Sdk="Microsoft.NET.Sdk"> 
 

 
    <PropertyGroup> 
 
    <OutputType>Exe</OutputType> 
 
    <TargetFramework>netcoreapp2.0</TargetFramework> 
 
    <RuntimeFrameworkVersion>2.0.0-preview1-002111-00</RuntimeFrameworkVersion> 
 
    </PropertyGroup> 
 

 
</Project>

  • çalıştırın, geri projeyi inşa Nuget
      ve gitmek iyi olmalı
  • 3

    Mac için Visual Studio 7.1, .NET Core 2.0 Preview 2 ile uyumludur, ancak şu anda beta sürümündedir. Ana menüden "Güncellemeleri Kontrol Et" i seçin ve "Beta" kanalına geçin. Bkz. Xamarin docs ve preview release notes.

    0

    Artık .NET Core 2.0'ı here'dan edinebilir ve sonra pkg'yi yükleyebilirsiniz. Sonraki adım, çözümde hedef çerçeveyi değiştirirken vs eğlenmek!