Does anyone know where I can take a look at my project if after I make a build with MSBuild through MSBuild console I get this warning:
MSB4078: The project file 'MyProject.csproj' is not supported by MSBuild and cannot be built?
My project is running with Target Framework .Net Core 2.0. The MSBuild version I am using is 14.0.25420.1
This is the cs.proj
You are using the new csproj file format (see Project sdk=...
)
You will need to use MSBuild 15 in order for it to build. You have two options:
1) Download Build Tools for Visual Studio 2017 and install. Then the path will be:
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin
2) If you have VS installed, the path will be:
C:\Program Files (x86)\Microsoft Visual Studio\2017\<VS Version>\MSBuild\15.0\Bin
Using MSBuild 15 should fix the error.
I suggest to use MSBuild in more reliable way.
Download Build Tools for Visual Studio 2017 from Visual Studio Downloads page, it includes latest MSBuild 15.* (direct link).
Command-line arguments documented here: Use command-line parameters to install Visual Studio 2017.
All workloads and components are listed here: Visual Studio Build Tools 2017 component directory.
Use PowerShell module VSSetup
to find MSBuild. Download it or install from here: Github: Microsoft/Visual Studio Setup PowerShell Module
Find MS Build
Import-Module $PSScriptRoot\VSSetup\VSSetup.psd1
$msBuildPath = (Get-VSSetupInstance | Select-VSSetupInstance -Version 15.0 -Product Microsoft.VisualStudio.Product.BuildTools).InstallationPath
if ([System.IntPtr]::Size -eq 8)
{
$global:msbuildPath = Join-Path $msBuildPath 'MSBuild\15.0\Bin\amd64'
}
else
{
$global:msbuildPath = Join-Path $msBuildPath 'MSBuild\15.0\Bin'
}
Write-Output "Using MSBuild from $global:msbuildPath"
Write-Output "MSBuild /version"
$msbuild = Join-Path $global:msbuildPath msbuild
& $msbuild /version
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With