Created
November 21, 2018 14:35
-
-
Save onyxmaster/b0886c8c5b883aa33654f0010b55eea0 to your computer and use it in GitHub Desktop.
A simple tool to write out target framework for a project, handles legacy (TargetFrameworkVersion) and new (TargetFramework) projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@"%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\amd64\MSBuild.exe" /nologo /clp:DisableConsoleColor;NoSummary /v:m /p:TargetProject="%~f1" "%~dp0%WriteFrameworkVersions.targets" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project DefaultTargets="WriteFrameworkVersions" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<Import Project="$(TargetProject)" /> | |
<Target Name="WriteFrameworkVersions"> | |
<Message Text="TargetFramework=$(TargetFramework)" Importance="high" Condition="'$(TargetFramework)' != ''" /> | |
<Message Text="TargetFrameworkVersion=$(TargetFrameworkVersion)" Importance="high" Condition="'$(TargetFramework)' == ''" /> | |
</Target> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment