question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

2.1-preview1 dotnet restore fails with "Microsoft.NET.Sdk.Web/Sdk/Sdk.props could not be loaded."

See original GitHub issue

Steps to reproduce

Inside of an ASP.NET Core 2.1 Preview 1 project run the following command:

$ docker run --rm -v $(pwd):/root/code microsoft/aspnetcore-build:2.1.300-preview1 dotnet restore

Expected behavior

This should spin up a microsoft/aspnetcore-build container with the latest 2.1-preview .NET SDK and restore the current project’s dependencies.

Actual behavior

Container is created and an error is immediately thrown upon attempting to restore:

/root/code/App.csproj : error MSB4024: The imported project file "/usr/share/dotnet/sdk/2.1.300-preview1-008174/Sdks/Microsoft.NET.Sdk.Web/Sdk/Sdk.props" could not be loaded. Data at the root level is invalid. Line 1, position 1.

It should be noted that this same $ dotnet restore command works just fine on my local mac running the same version of the SDK. It is crucial for the same command to work inside Docker as we use containers for local dev as well as production deployments.

Environment data

Running:

docker run --rm -v $(pwd):/root/code microsoft/aspnetcore-build:2.1.300-preview1 dotnet --info

Produces:

.NET Command Line Tools (2.1.300-preview1-008174)

Product Information:
 Version:            2.1.300-preview1-008174
 Commit SHA-1 hash:  b8df89a54f

Runtime Environment:
 OS Name:     debian
 OS Version:  9
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/2.1.300-preview1-008174/

Microsoft .NET Core Shared Framework Host

  Version  : 2.1.0-preview1-26216-03
  Build    : f2c3216183d20416568a4bbf5bb7d153e826f153

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
livarcocccommented, Mar 1, 2018

Ok. Given that this seems like a transient docker issue, I am closing this issue.

If some new development happens though, feel free to comment and we can re-activate.

0reactions
pheutercommented, Mar 1, 2018

@peterhuene huh, that’s weird. so i figured it must have something to do with Docker itself and now that command works once I reset my Docker virtual disk image.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found