Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK-based project with new target platforms #21

Merged
merged 8 commits into from
Oct 17, 2019
Merged

SDK-based project with new target platforms #21

merged 8 commits into from
Oct 17, 2019

Conversation

3F
Copy link
Owner

@3F 3F commented Sep 29, 2019

Closes #11

Update 1

Target platforms

So, what we decided for today:

I already described process of using with new msbuild packages (contains logic with new Installation API that fixes all active third-software problems) via getnutool + vssbe scrips in issue on nuget project.

However, I still have thoughts about dynamically fixing this dependency. I mean some automation, or rather delegation of responsibilities to ~a configurable loader, accessible to end-users. Here mentioned: #5

Therefore, today's solving the problem of the new API (and more) we will still decide in the same manner like in our wiki: https://github.com/3F/MvsSln/wiki/Examples-override-MS-Project

And finally we'll make today's support for netcore very simple using their available platforms.

(Obsolete)

This adds at least netstandard2.0 and net40.

Planned

  • Probably decrease to netstandard1.1.

Key notes

NU1202. PackageReference vs Reference

<ItemGroup Condition=" '$(TargetFramework)' == 'net40' ">
  <Reference Include="Microsoft.CSharp" />
  <Reference Include="Microsoft.Build" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
  <PackageReference Include="Microsoft.CSharp" Version="4.6.0" />
  <PackageReference Include="Microsoft.Build" Version="15.9.20" />
</ItemGroup>

15.9.20 is last package with netstandard2.0 target support. 16.0.461 and 16.3.0 contains only .NETCoreApp2.1 and net472. That is, we can try to use Reference for net472 -> netstandard2.0.

NU1202 and netstandard1.1.

For netstandard1.1 I don't see any directly compatible packages. Thus, I'm not sure about PackageReference (any options to disable NU1202 ?) but we can also use at least Reference with some potential problems like MSB3277. For example:

<ItemGroup Condition=" '$(TargetFramework)' == 'net40' ">
  <Reference Include="Microsoft.Build" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.1' ">
  <Reference Include="Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    <HintPath>..\packages\microsoft.build.15.9.20\lib\net46\Microsoft.Build.dll</HintPath>
    <Private>True</Private>
  </Reference>

  <!-- Use this to avoid MSB3277 - conflicts between different versions of "System.IO.Compression" -->
  <Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <HintPath>..\packages\system.io.compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath>
    <Private>True</Private>
  </Reference>
  
</ItemGroup>

Cc: @HamedFathi, @carstencodes

@3F 3F mentioned this pull request Oct 5, 2019
@3F
Copy link
Owner Author

3F commented Oct 12, 2019

Something wrong with tests. Different build for the same commit e9ab8b6:

Microsoft.Build.Exceptions.InvalidProjectFileException : The project file could not be loaded. Could not find a part of the path 'C:\snet\snet.csproj'. 
Microsoft.Build.Exceptions.InvalidProjectFileException : The project file could not be loaded. Could not find a part of the path 'C:\snet\snet.csproj'. 

The same reason, that's good to isolate problem. But my pc can't reproduce even something -_- rdp is coming

@3F 3F mentioned this pull request Oct 15, 2019
Also removed net46 due to net472 changes.

Details in #21
@3F
Copy link
Owner Author

3F commented Oct 16, 2019

Finally this PR will not contain net46. And net472 will no longer reference modern MSBuild packages!

This is because of many additional steps with MSBuild Resolver and MSBuildLocator for trivial use.

However, user can still use custom MSBuild assemblies if needed.

I updated wiki info + added this: https://github.com/3F/MvsSln/wiki/Advanced-Features#how-to-use-modern-versions-of-msbuild-for-netfx

Summary, only netcoreapp2.1 (-> 16.3.0) & netstandard2.0 (-> 15.9.20) will reference packages.

Many, so many problems with modern MSBuild :(

I hope our wiki can help to solve all or most known problems! And I hope for 3.x when we will drop MSBuild dep.

@3F 3F changed the title WIP. SDK-based project with new target platforms SDK-based project with new target platforms Oct 17, 2019
@3F 3F merged commit a4a94b7 into master Oct 17, 2019
@3F 3F deleted the dev/issue/11 branch October 17, 2019 16:18
3F added a commit that referenced this pull request Oct 17, 2019
* FIXED: Fixed parallelism problems when using Sln wrapper.

* FIXED: Incorrect initialization for ProjectReferences class.

* NEW: Added .net core based target platforms: netcoreapp2.1. + netstandard2.0. Issue #11.

* NEW: Added netfx based target platforms: net472. PR #21.

* NEW: IXProject methods:
    ```
    +bool AddPackageReference(string id, string version, IEnumerable<KeyValuePair<string, string>> meta = null);
    +Item GetFirstPackageReference(string id);
    +bool RemovePackageReference(string id);
    ```

* CHANGED: EnvDTE features are obsolete now. Scheduled for removal in future major releases. Issue #22.

* CHANGED: MathExtension.CalculateHashCode now encapsulates GetHashCode() with null checking.

* CHANGED: Compatible signature changes for the following extension method:
    ```
    AddOrUpdate(this IDictionary<string, string> source, IEnumerable<KeyValuePair<string, string>> items)
    ```

* KNOWN: Various [ possible ] problems when using modern MSBuild assemblies.

        ! Solution and details in our wiki:
        https://github.com/3F/MvsSln/wiki/Advanced-Features

        Do not hesitate to contact: https://github.com/3F/MvsSln/issues

* NOTE: Discuss the planned v3.0 and its major changes:
        https://github.com/3F/MvsSln/milestone/4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Please support .NET Core
1 participant