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.

dotnet build of aspnet core on net461 with net461 dependencies don't build

See original GitHub issue

Steps to reproduce

Create new project in VS

  • ASP.NET Core .NET Framework Project
  • .NET Framework class library child project
  • Reference class lib from web proj
  • Add “var foo = new Class1();” and appropriate using to Home controller.
  • dotnet run in web project from CLI.

Expected behavior

  • successful build and run

Actual behavior

C:\Users\rich\Documents\Visual Studio 2017\Projects\WebApplication3\WebApplication3>dotnet build
Microsoft (R) Build Engine version 15.3.388.41745 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

Controllers\HomeController.cs(8,7): error CS0246: The type or namespace name 'ClassLibrary1' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\rich\Documents\Visual Studio 2017\Projects\WebApplication3\WebApplication3\WebApplication3.csproj]

Build FAILED.

Controllers\HomeController.cs(8,7): error CS0246: The type or namespace name 'ClassLibrary1' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\rich\Documents\Visual Studio 2017\Projects\WebApplication3\WebApplication3\WebApplication3.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:02.04

Then build wen project in VS 2017 15.3 Then dotnet run and everything works.

Environment data

dotnet --info output:

C:\Users\rich\Documents\Visual Studio 2017\Projects\WebApplication3\WebApplication3>dotnet --info .NET Command Line Tools (2.0.0-preview2-006497)

Product Information: Version: 2.0.0-preview2-006497 Commit SHA-1 hash: 06a2093335

Runtime Environment: OS Name: Windows OS Version: 10.0.15063 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.0.0-preview2-006497\

Microsoft .NET Core Shared Framework Host

Version : 2.0.0-preview2-25407-01 Build : 40c565230930ead58a50719c0ec799df77bddee9

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
livarcocccommented, Jul 8, 2017

Are all these SDK based projects? Could you share the repro projects?

0reactions
livarcocccommented, Jul 13, 2017

@richlander as we talked, this is an issue with how often VS saves the project file. If we need to change this, we should start with the project-system repo.

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet build of aspnet core on net461 with ...
dotnet run in web project from CLI. Expected behavior. successful build and run. Actual behavior. C:\Users\rich\Documents\Visual Studio 2017 ...
Read more >
Dependencies not working when running ASP.NET Core ...
After a bit of investigation I found a good solution. My project consists of some classic .NET class libraries being referenced by an...
Read more >
dotnet build command - .NET CLI
The dotnet build command builds a project and all of its dependencies.
Read more >
MSBuild reference for .NET SDK projects
Reference for the MSBuild properties and items that are understood by the .NET SDK.
Read more >
Building NuGet packages with Dotnet Core | by Xavier Penya
The package doesn't work if I have multiple projects. dotnet pack just packs a single project. It doesn't pack all of its project...
Read more >

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