--- /dev/null
+<Project>
+
+ <PropertyGroup Condition="$(TargetFramework.Contains('-'))">
+ <_OriginalTargetFramework>$(TargetFramework)</_OriginalTargetFramework>
+ <TargetFrameworkSuffix>$(TargetFramework.SubString($([MSBuild]::Add($(TargetFramework.IndexOf('-')), 1))))</TargetFrameworkSuffix>
+ <TargetFramework>$(TargetFramework.SubString(0, $(TargetFramework.IndexOf('-'))))</TargetFramework>
+ </PropertyGroup>
+
+ <PropertyGroup>
+ <RefPath>$([MSBuild]::NormalizeDirectory('$(RefRootPath)', '$(TargetFramework)'))</RefPath>
+ </PropertyGroup>
+
+ <Import Project="$(MSBuildThisDirectory)targetframeworksuffix.props" Condition="'$(DesignTimeBuild)' == 'true'" />
+
+ <PropertyGroup>
+ <IntermediateOutputPath>$([MSBuild]::NormalizeDirectory('$(BaseIntermediateOutputPath)', '$(TargetFramework)-$(TargetFrameworkSuffix)-$(Configuration)'))</IntermediateOutputPath>
+ <IntermediateOutputPath Condition="'$(TargetFrameworkSuffix)' == ''">$([MSBuild]::NormalizeDirectory('$(BaseIntermediateOutputPath)', '$(TargetFramework)-$(Configuration)'))</IntermediateOutputPath>
+ <!-- setting the output paths -->
+ <OutputPath>$([MSBuild]::NormalizeDirectory('$(BaseOutputPath)', '$(TargetFramework)-$(TargetFrameworkSuffix)-$(Configuration)'))</OutputPath>
+ <OutputPath Condition="'$(TargetFrameworkSuffix)' == ''">$([MSBuild]::NormalizeDirectory('$(BaseOutputPath)', '$(TargetFramework)-$(Configuration)'))</OutputPath>
+ </PropertyGroup>
+
+</Project>
+++ /dev/null
-<Project>
- <!-- We are reseting the target framework, so we need to reset the properties derived by the sdk
- eg TargetFrameworkIdentifier, TargetFrameworkVersion. In order to do that we are copying the sdk
- parsing code https://github.com/dotnet/sdk/blob/master/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.TargetFrameworkInference.targets#L47
- -->
- <PropertyGroup>
- <_UnsupportedTargetFrameworkError></_UnsupportedTargetFrameworkError>
- <TargetFrameworkIdentifier></TargetFrameworkIdentifier>
- <TargetFrameworkVersion></TargetFrameworkVersion>
- <TargetFrameworkMoniker></TargetFrameworkMoniker>
- <NuGetTargetMoniker></NuGetTargetMoniker>
- </PropertyGroup>
-
- <PropertyGroup Condition="$(TargetFramework.Contains('-'))">
- <_OriginalTargetFramework>$(TargetFramework)</_OriginalTargetFramework>
- <TargetFrameworkSuffix>$(TargetFramework.SubString($([MSBuild]::Add($(TargetFramework.IndexOf('-')), 1))))</TargetFrameworkSuffix>
- <TargetFramework>$(TargetFramework.SubString(0, $(TargetFramework.IndexOf('-'))))</TargetFramework>
- </PropertyGroup>
-
- <PropertyGroup>
- <RefPath>$([MSBuild]::NormalizeDirectory('$(RefRootPath)', '$(TargetFramework)'))</RefPath>
- </PropertyGroup>
-
- <!-- Split $(TargetFramework) (e.g. net45) into short identifier and short version (e.g. 'net' and '45'). -->
- <PropertyGroup Condition="'$(TargetFramework)' != '' and !$(TargetFramework.Contains(',')) and !$(TargetFramework.Contains('+'))">
- <_ShortFrameworkIdentifier>$(TargetFramework.TrimEnd('.0123456789'))</_ShortFrameworkIdentifier>
- <_ShortFrameworkVersion>$(TargetFramework.Substring($(_ShortFrameworkIdentifier.Length)))</_ShortFrameworkVersion>
- </PropertyGroup>
-
- <!-- Versions with dots are taken as is and just given leading 'v'. -->
- <PropertyGroup Condition="'$(TargetFrameworkVersion)' == '' and '$(_ShortFrameworkVersion)' != '' and $(_ShortFrameworkVersion.Contains('.'))">
- <TargetFrameworkVersion>v$(_ShortFrameworkVersion)</TargetFrameworkVersion>
- </PropertyGroup>
-
- <!-- Versions with no dots and up to 3 characters get leading 'v' and implicit dots between characters. -->
- <PropertyGroup Condition="'$(TargetFrameworkVersion)' == '' and '$(_ShortFrameworkVersion)' != ''">
- <TargetFrameworkVersion Condition="$(_ShortFrameworkVersion.Length) == 1">v$(_ShortFrameworkVersion[0]).0</TargetFrameworkVersion>
- <TargetFrameworkVersion Condition="$(_ShortFrameworkVersion.Length) == 2">v$(_ShortFrameworkVersion[0]).$(_ShortFrameworkVersion[1])</TargetFrameworkVersion>
- <TargetFrameworkVersion Condition="$(_ShortFrameworkVersion.Length) == 3">v$(_ShortFrameworkVersion[0]).$(_ShortFrameworkVersion[1]).$(_ShortFrameworkVersion[2])</TargetFrameworkVersion>
- </PropertyGroup>
-
- <!-- Map short name to long name. See earlier comment for example of how to work with identifiers that are not recognized here. -->
- <PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == ''">
- <TargetFrameworkIdentifier Condition="'$(_ShortFrameworkIdentifier)' == 'netstandard'">.NETStandard</TargetFrameworkIdentifier>
- <TargetFrameworkIdentifier Condition="'$(_ShortFrameworkIdentifier)' == 'netcoreapp'">.NETCoreApp</TargetFrameworkIdentifier>
-
- <!-- The meaning of "net" as a short framework name depends on the version. If it's 4.x or less, it means .NETFramework.
- If the version is 5.0 or higher, then "net" means .NET 5.0 and on, which is the evolution of .NET Core, and uses
- the .NETCoreApp TargetFrameworkIdentifier. -->
- <TargetFrameworkIdentifier Condition="'$(_ShortFrameworkIdentifier)' == 'net' And
- $([MSBuild]::VersionLessThan($(TargetFrameworkVersion), '5.0'))">.NETFramework</TargetFrameworkIdentifier>
- <TargetFrameworkIdentifier Condition="'$(_ShortFrameworkIdentifier)' == 'net' And
- $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '5.0'))">.NETCoreApp</TargetFrameworkIdentifier>
- </PropertyGroup>
-
- <!--
- Trigger an error if we're unable to infer the framework identifier and version.
- We have to evaluate this here and not in the target because by the time the target runs,
- Microsoft.Common.targets will have defaulted to .NETFramework,Version=v4.0
- -->
- <PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '' or '$(TargetFrameworkVersion)' == ''">
- <_UnsupportedTargetFrameworkError>true</_UnsupportedTargetFrameworkError>
- </PropertyGroup>
-
- <Import Project="$(MSBuildThisDirectory)targetframework.props" />
-
- <PropertyGroup Condition="'$(TargetFrameworkIdentifier)' != '' and '$(TargetFrameworkVersion)' != ''">
- <TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == '' and '$([System.String]::IsNullOrWhitespace($(TargetFrameworkProfile)))' != 'true'">$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion),Profile=$(TargetFrameworkProfile)</TargetFrameworkMoniker>
- <TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == ''">$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion)</TargetFrameworkMoniker>
- </PropertyGroup>
-
- <PropertyGroup>
- <!-- Note that the assets.cache file has contents that are unique to the current TFM and configuration and therefore cannot
- be stored in a shared directory next to the assets.json file -->
- <ProjectAssetsCacheFile Condition="'$(ProjectAssetsCacheFile)' == ''">$(IntermediateOutputPath)$(MSBuildProjectName).assets.cache</ProjectAssetsCacheFile>
- <ProjectAssetsCacheFile>$([MSBuild]::NormalizePath($(MSBuildProjectDirectory), $(ProjectAssetsCacheFile)))</ProjectAssetsCacheFile>
- <NuGetTargetMoniker>$(TargetFrameworkMoniker)</NuGetTargetMoniker>
- <!-- We change the default value of the output path set by the sdk in our targetframework.props file.
- We need to update the properties derived from the output path in order to reflect the change.
- TargetPath is one of such property. -->
- <TargetPath>$(OutputPath)$(TargetFileName)</TargetPath>
- <OutDir>$(OutputPath)</OutDir>
- </PropertyGroup>
-
-</Project>