2017-03-17 19 views
2

私はちょうどVS2017をインストールしました。私の.NETコアプロジェクトをproject.json形式から新しいcsproj形式に移行しました。私が望むのは、複数のフレームワークを対象にして、フレームワークのDependenent Deploymentと小さなフットプリントを使用したSelf Contained Deploymentを構築することです。私はMSのドキュメントの指示に従っていましたが、TargetFrameworksにnetstandard1.6またはnetstandard2.0を含めると、プロジェクトを作成してビルドするときに、Predefined type System.Object is not definedThe type of namespace System could not be foundのスルーが表示されます。これはproject.jsonファイルを使用しているときに機能しました。私csprojは私の元project.jsonVisual Studio 2017 csproj。NET CORE netstandard2.0 not building

{ 
    "version": "1.0.0.0", 
    "buildOptions": { 
    "emitEntryPoint": true 
    }, 

    "frameworks": { 
    "netcoreapp1.2": { 
     "dependencies": { 
     "Microsoft.NETCore.App": { 
      "type": "platform", 
      "version": "1.1.0" 
     } 
     } 
    }, 
    "netstandard2.0": { 
     "dependencies": { 
     "NETStandard.Library": { 
      "version": "1.6.1" 
     }, 
     "System.Threading.Thread": "4.3.0", 
     "Microsoft.NETCore.Runtime.CoreCLR": "1.1.0" 
     } 
    } 
    }, 

    "runtimes": { 
    "win10-x64": {} 
    "ubuntu.16.10-x64": {}, 
    "centos.7-x64": {}, 
    "debian.8-x64": {}, 
    "fedora.24-x64": {}, 
    "opensuse.42.1-x64": {}, 
    "osx10.12-x64" : {} 
    } 
} 

問題が何であるかわからない

<Project Sdk="Microsoft.NET.Sdk"> 
    <PropertyGroup> 
    <VersionPrefix>1.0.0.0</VersionPrefix> 
    <TargetFrameworks>netcoreapp1.2;netstandard2.0</TargetFrameworks> 
    <AssemblyName>App</AssemblyName> 
    <OutputType>Exe</OutputType> 
    <PackageId>App</PackageId> 
    <RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp1.2' ">1.1.1</RuntimeFrameworkVersion>--> 
    <NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard2.0' ">1.6.1</NetStandardImplicitPackageVersion> 
    <RuntimeIdentifiers>win10-x64;android.21;android21-arm64;osx.10.12;rhel7.4;centos.7-x64;debian8-x64;ubuntu16.10-x64;fedora.26-x64;opensuse.42.1-x64</RuntimeIdentifiers> 
    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> 
    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> 
    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute 
    </PropertyGroup> 

    <ItemGroup> 
    <None Remove="App.csproj.vspscc" /> 
    </ItemGroup> 

    <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> 
    <PackageReference Include="System.Threading.Thread" Version="4.3.0" /> 
    <PackageReference Include="Microsoft.NETCore.Runtime.CoreCLR" Version="1.1.0" /> 
    </ItemGroup> 

</Project> 

です。私はサポートされていない何かをしようとしていますか?私がnetcoreapp1.2を持っていれば、私はdotnetを発行するときに-c Release -r win10-x64を発行しますが、スタンドアロンの実行可能ファイルではなくFDD出力が得られます。私はこれがjsonファイルの方が簡単だったように感じます...どうしたのですか?

答えて

3

Nugetパッケージが復元されなかった場合、同じエラーメッセージが表示されます。パッケージが適切に復元されていることを確認しましたか?ドットネットリストアを実行するとエラーは表示されませんか?

+0

私はそれをやったと誓っていたので、私は本当に馬鹿だと感じましたが、今朝もう一度それを試みると、そうだったようです。ありがとう! – hakenmt

+0

素晴らしい!ときどき2つの余分な目が必要な場合もあります。 – Bebben

関連する問題