dotnet build of aspnet core on net461 with net461 dependencies don't build
See original GitHub issueSteps 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:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Are all these SDK based projects? Could you share the repro projects?
@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.