Xamarin.Forms netstandard 项目因更新到 VS 2017.3 而中断
Xamarin.Forms netstandard project broken with update to VS 2017.3
所以今天我错误地将 IDE 更新到 2017.3。
然后我收到了不兼容的通知,例如
"NU1202: The package Xamarin.Forms 2.3.4.247 is not compatible with netstandard1.5. Package supports: list of targets such as monoandroid10, xamarinios10, etc"
在 google 上调查此事后,我找到了一些信息来尝试修复该项目。
https://github.com/NancyFx/Nancy/issues/2647#issuecomment-265927440 建议添加一个 frameworkmoniker 来构建它(在修复尝试的某个时候我也有一个平台警告)
我为解决此问题所做的另一种尝试是将项目重新创建为使用 netstandard 项目的新模板版本(我为重现提供的项目是在 project.json还是一件事)
您可能会问为什么:在查找问题时,我读到一些是误报错误消息,可以像这样禁用它们 Package Reference Warning Ignore - 但是在这个完全基于 .csproj 的项目类型中我无法添加 Xamarin.Forms 2.3.4.247.
所以我的问题是:
有没有人能够在 vs2017.3 上获得类似的项目运行?
REPRO 项目:
更改我的项目后结果与此类似:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.5</TargetFramework>
<PackageTargetFallback>portable-net45+win8+wpa81+wp8</PackageTargetFallback>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="App.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
<EmbeddedResource Include="MainPage.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.Portable.Compatibility" Version="1.0.1" />
<PackageReference Include="Xamarin.Forms" Version="2.3.4.247" />
</ItemGroup>
<ItemGroup>
<Compile Update="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Update="MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
</ItemGroup>
</Project>
项目重新编译
<PackageTargetFallback>portable-net45+win8+wpa81+wp8</PackageTargetFallback>
已解决问题。
所以今天我错误地将 IDE 更新到 2017.3。
然后我收到了不兼容的通知,例如
"NU1202: The package Xamarin.Forms 2.3.4.247 is not compatible with netstandard1.5. Package supports: list of targets such as monoandroid10, xamarinios10, etc"
在 google 上调查此事后,我找到了一些信息来尝试修复该项目。
https://github.com/NancyFx/Nancy/issues/2647#issuecomment-265927440 建议添加一个 frameworkmoniker 来构建它(在修复尝试的某个时候我也有一个平台警告)
我为解决此问题所做的另一种尝试是将项目重新创建为使用 netstandard 项目的新模板版本(我为重现提供的项目是在 project.json还是一件事)
您可能会问为什么:在查找问题时,我读到一些是误报错误消息,可以像这样禁用它们 Package Reference Warning Ignore - 但是在这个完全基于 .csproj 的项目类型中我无法添加 Xamarin.Forms 2.3.4.247.
所以我的问题是:
有没有人能够在 vs2017.3 上获得类似的项目运行?
REPRO 项目:
更改我的项目后结果与此类似:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.5</TargetFramework>
<PackageTargetFallback>portable-net45+win8+wpa81+wp8</PackageTargetFallback>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="App.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
<EmbeddedResource Include="MainPage.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.Portable.Compatibility" Version="1.0.1" />
<PackageReference Include="Xamarin.Forms" Version="2.3.4.247" />
</ItemGroup>
<ItemGroup>
<Compile Update="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Update="MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
</ItemGroup>
</Project>
项目重新编译
<PackageTargetFallback>portable-net45+win8+wpa81+wp8</PackageTargetFallback>
已解决问题。