我在 mac 上使用带有最新 .Net Core SDK 的 Visual Studio mac。在 Windows 上的 Visual Studio 2017 RC 中,一切正常,但是当我尝试使用 Visual Studio Mac 在 Mac 上恢复 nuget 包时,它会抛出错误。
包 Microsoft.Composition 1.0.27 与 netcoreapp1.1 (.NETCoreApp,Version=v1.1) 不兼容。包 Microsoft.Composition 1.0.27 支持:portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259) 一个或多个包与 .NETCoreApp,Version=v1.1 不兼容。
这是我的 *.csproj 文件
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<Description>Some</Description>
<Copyright>Some</Copyright>
<AssemblyTitle>Some</AssemblyTitle>
<TargetFramework>netcoreapp1.1</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>SharpCommerce</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>Some</PackageId>
<UserSecretsId>aspnet-SharpCommerce-ecd1a4f7-1de0-468a-8065-ab902c7aae9b</UserSecretsId>
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;portable-net45+win8;portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<PreBuildEvent></PreBuildEvent>
</PropertyGroup>
<ItemGroup>
<Content Update="wwwroot\**\*;**\*.cshtml;appsettings.json;web.config">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.0">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="1.0.0-msbuild3-final">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="1.1.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink.Loader" Version="14.1.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration" Version="1.1.0-preview4-final" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="1.1.0-msbuild3-final">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor" Version="1.1.1" />
<PackageReference Include="System.IO.FileSystem" Version="4.3.0" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="1.1.0" />
<PackageReference Include="System.Reflection" Version="4.3.0" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="1.3.2" />
</ItemGroup>
<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
<Exec Command="bower install" />
<Exec Command="dotnet bundle" />
</Target>
<ItemGroup>
<ProjectReference Include="..\..\Some.Core.Contracts\Some.Core.Contracts.csproj" />
<ProjectReference Include="..\..\Some.Core\Some.Core.csproj" />
</ItemGroup>
</Project>