Closed KirillOsenkov closed 5 years ago
@KirillOsenkov support for NETFRAMEWORK
\ NETCOREAPP
constants was added as part of the 2.1.3 SDK. If you don't have it installing, running .\build /t:Restore
should install it for you. You can run dotnet build
once it's in your PATH
Thanks! Shouldn't it default to NETFRAMEWORK in that case? Or is having an SDK a prerequisite?
Since we very commonly cross-compile in the AspNetCore repos, having it error was a safer bet than defaulting and using the incorrect API. Our repos often times use new SDK features (for instance I've seen a few places with FrameworkReference
items that's still in 3.0 preview) and may not build with an older Sdk. Letting the build install the Sdk it thinks works is generally the path of least resistance.
Understood. You decide whether to close this issue or if you still want to do something about it.
It's just strange that that one error seems to be the only place where the build breaks if you just build "by default". I'd expect either a clean build or a lot of errors.
Thanks @KirillOsenkov and @pranavkm! Closing this as this repo will eventually move to AspNetCore where build will be slightly different, while the rules may still be applicable.
git clone https://github.com/aspnet/razor
nuget restore
msbuild /bl
Expected: builds fine
Actual:
This is because neither
NETFRAMEWORK
norNETCOREAPP
define is defined.I realize the instructions say to use build.cmd (which will eventually call run.ps1 which will use KoreBuild), however it feels like it's very close to be able to build just by using nuget restore + msbuild.
I'm filing this bug in hope that there's an easy default somewhere that will allow this repo to build by just calling
msbuild /r
. This is an ideal that repos in our ecosystem should strive towards, because custom tooling such as build.cmd or KoreBuild is not standard and so creates barriers that are probably avoidable.