Adapt project for vs2017(using vs2019 leads to an error 'Could not load type of field')

This commit is contained in:
yangzhi 2020-02-07 15:01:46 +08:00
parent df166d0df7
commit 7366796a53
6 changed files with 7 additions and 8 deletions

View File

@ -11,6 +11,12 @@
<DefineConstants Condition="$(OS) == 'Windows_NT'">$(DefineConstants);SMAPI_FOR_WINDOWS</DefineConstants> <DefineConstants Condition="$(OS) == 'Windows_NT'">$(DefineConstants);SMAPI_FOR_WINDOWS</DefineConstants>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Net.Compilers" Version="3.3.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<!-- if game path is invalid, show one user-friendly error instead of a slew of reference errors --> <!-- if game path is invalid, show one user-friendly error instead of a slew of reference errors -->
<Target Name="ValidateInstallPath" AfterTargets="BeforeBuild"> <Target Name="ValidateInstallPath" AfterTargets="BeforeBuild">
<Error Condition="!Exists('$(GamePath)')" Text="Failed to find the game install path automatically. You can specify where to find it; see https://smapi.io/package/custom-game-path." /> <Error Condition="!Exists('$(GamePath)')" Text="Failed to find the game install path automatically. You can specify where to find it; see https://smapi.io/package/custom-game-path." />

View File

@ -1,4 +1,3 @@
#if SMAPI_FOR_WINDOWS
using System; using System;
using Galaxy.Api; using Galaxy.Api;
using StardewValley.Network; using StardewValley.Network;
@ -50,4 +49,3 @@ namespace StardewModdingAPI.Framework.Networking
} }
} }
} }
#endif

View File

@ -1,4 +1,3 @@
#if SMAPI_FOR_WINDOWS
using System; using System;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.IO; using System.IO;
@ -74,4 +73,3 @@ namespace StardewModdingAPI.Framework.Networking
} }
} }
} }
#endif

View File

@ -1,4 +1,3 @@
#if SMAPI_FOR_WINDOWS
using System; using System;
using StardewValley.Network; using StardewValley.Network;
@ -49,4 +48,3 @@ namespace StardewModdingAPI.Framework.Networking
} }
} }
} }
#endif

View File

@ -1,4 +1,3 @@
#if SMAPI_FOR_WINDOWS
using System; using System;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.IO; using System.IO;
@ -68,4 +67,3 @@ namespace StardewModdingAPI.Framework.Networking
} }
} }
} }
#endif

View File

@ -26,6 +26,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<LangVersion>latest</LangVersion>
<LangVersion>8.0</LangVersion> <LangVersion>8.0</LangVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">