Aspnetcore: Huge build time increase for .NETCoreApp,Version v1.1

Created on 18 Nov 2016  路  10Comments  路  Source: dotnet/aspnetcore

I've updated my ASP.NET Core application to .NET Core 1.1 and ASP.NET Core 1.1 runtime packages. Using 1.0 building took ~5 seconds. After the update it's ~40 seconds.

When I set "preserveCompilationContext": false in the project.json, the build time goes down to ~1 sec.

My application is rather large and pulls in a fair amount of dependencies. It does not repro with a new project.

Most helpful comment

I just removed it. But the latest version is 1.0.0-preview2-1-003177.

All 10 comments

Guess I found it. I had left an older version of the .NET Core CLI in my global.json:

{
  "projects": [ "src", "test" ],
  "sdk": {
    "version": "1.0.0-preview2-003131"
  }
}

The build runs successful, it's just terribly slow. Removing the sdk element fixed it.

Perhaps a warning from the CLI that the SDK version in global.json and the .NET Core version of the application do not match would come in handy.

What is the latest (for v1.1) SDK Version?

I just removed it. But the latest version is 1.0.0-preview2-1-003177.

I'm seeing a similar issue (build time went from a couple of seconds in 1.0 to more than a minute in 1.1) but I don't reference any SDK version in the global.json. Where else could this come from and how can I troubleshoot?

The project I build relies on libraries running .NET Standard 1.6, if that matters. Their compilation time is unchanged from before.

I also have a massive slowdown of build time after upgrading to 1.1.0.

Changing the framework to 1.1.0 and leaving all packages at 1.0.0 keeps building time low, but upgrading all packages in the nuget packet manager (or manually) will increase build time to >20 seconds.

I have the same issue with a brand new "blank" asp.net core template for a web application.

Edit: Finally fixed with the correct entry in the global.json file, I don't know why that did not work when I wrote the post.

I had the same problem. I've reduced the build time from 30 seconds to 3 seconds by updating the sdk version in global.json.

A warning from the CLI would help in this scenario.

I updated sdk version in global.json to "1.0.0-preview2-1-003177" and build time reduced from 56 seconds to 2 seconds!

Thank you.

As a VS 2015 user it took me a bit to find the correct SDK to download. In case it helps someone else here is the link to the archived 003177 SDK: https://github.com/dotnet/core/blob/master/release-notes/download-archives/1.1-preview2.1-download.md

I'm a VS 2015 user as well and recently began working on a project that had the following global.json file:
```{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-preview2-003131"
}
}

I was getting untolerable ~1min build times. I had downloaded SDK 1.0.1, but I was unable to edit the global.json to use that version. 

I followed @daveronson 's suggestion above, downloaded the appropriate SDK and changed by global.json to read as follows, which resolved my build time issue.

```{
    "projects": [ "src", "test" ],
    "sdk": {
      "version": "1.0.0-preview2-1-003177"
    }
}

Could anyone please explain why I couldn't use "version":"1.0.1" even though it was installed? I'm pretty new to the dotnetcore world.

Was this page helpful?
0 / 5 - 0 ratings