Support for Windows 10 in Visual Studio
GaryDeco opened this issue · 4 comments
Extend kRPC to support building on Windows OS in Visual Studio .
- Add batch script to copy KSP_x64_Data from default windows location to lib/
- Fix csproj files to use common variable KSP_DIR defined by a OS check (linux or windows) .
- Tweak the windows/visual studio workflow.
I did some investigation into how to write a "modern" csproj file in the krpc2 repository. You should take a look at this: https://github.com/krpc/krpc2/blob/main/server/src/KRPC2.csproj
It's so much simpler than the old style. You don't need to specify all the .cs files, it just uses all the ones in the current directory. Also it uses netstandard2.0 (instead of .NET 4.5). That works with both KSP1 and KSP2, and is supported by Visual Studio 2022 🎉
I'm also now thinking we don't need that batch file to copy DLLs for various reasons:
- It's not needed once we can build with Bazel on Windows (which we will have eventually, and will be the preferred approach)
- All the script wil do is copy a folder into lib/ksp. Just get the user to do it manually! They only have to do it once, so I think this is fine.
- Not having this script is one less thing we have to maintain (which is a headache if we want it cross platform).
Issues with .NET 45 targeting and when target is set to .NET 48. Google Protobuf v 3.10.1 is required for KSP but .NET 48 forces upgrade to v 3.22 (Protobuf). Need to find workaround or solution for targeting .NET45. Environment variables already checked. There could be an issue with where dotnet looks for frameworks vs msbuild?