Keeping projects in sync across multiple .NET versions

前端 未结 2 1457
时光取名叫无心
时光取名叫无心 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:30

    What I do is:

    • have one "regular" csproj that I use for most of my dev, adding files etc - but remembering that really all files are "in"
    • for the other csproj, use something like:

      
        
      
      

    (that is basically the same as "add as link", but without needing to be done on a per-file basis)

    This is a recursive include of all *.cs files, so everything is in. No file maintenance needed.


    If you were trying to target multiple frameworks (rather than multiple versions), then another option might be: use a Portable Class Library. This is a single project that works on multiple frameworks, but is limited to the strict intersection of features from the platforms you target. In VS2010 this is an add-in feature; it is included by default in VS 11.

提交回复
热议问题