Keeping projects in sync across multiple .NET versions

前端 未结 2 1453
时光取名叫无心
时光取名叫无心 2020-12-21 02:09

I need to create some core libraries within my application which will be available in both .NET 3.5 and .NET 4.0. I\'m happy creating multiple projects, creating the require

2条回答
  •  再見小時候
    2020-12-21 02:37

    What I do with my cross platform projects is to have different slns, each for one platform.

    The shared code lives in a common location and is added "as a link" into the correct csproj's. This csproj also contain any platform specific files. If a "common code" file needs to be conditional based on current platform you can choose to replace that with two platform-specific files or put a #ifdef in it (depends on how much of it is different).

    Note that you can also add one solution to another inside Visual Studio. This "combined" solution can be used for automated builds for all platforms.

    Example: https://github.com/ananthonline/graffiti

    This works great for me, YMMV. Hope this helps.

提交回复
热议问题