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.

upgrade asp.net core targeting framework 4.6.1 from vs2015 to vs2017 - One or more compilation references are missing

See original GitHub issue

have upgraded my asp.net core,using project.json and targeting .net framework 4.6.1 on visual studio 2015 to visual studio 2017.

I have multiple projects in the solution where the main application is referencing them by project reference(all of them target net461).

When running the application I get

One or more compilation references are missing. Possible causes include a missing 'preserveCompilationContext' property under 'buildOptions' in the application's project.json. Screenshot: 11

And my csproj: webapp.txt

I’ll try to create a project to see if I can reproduce.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
AlexBarcommented, May 21, 2017

@livarcocc Looks like I found a way how to reproduce it:

  1. Create a new “ClassLibrary2”, targets “net461”.
  2. Create a new ASP.NET CORE app, targets “net461”
  3. Build ClassLibrary2 project into dll
  4. Add reference for web app to this dll
  5. Add to some razor page “using ClassLibrary2” (ClassLibrary2 - default namespace for the library)
  6. Run web app and you will see this error "The type or namespace name ‘ClassLibrary2’ could not be found (are you missing a using directive or an assembly reference?)

@using ClassLibrary2

example: WebApplication1.zip

1reaction
dominicrooijackerscommented, Jul 3, 2017

I got the same error message, in my case I had to fully qualify my Model (@model Project.Namespace.Classname) and then it worked.

Best regards Dominic Rooijackers

Read more comments on GitHub >

github_iconTop Results From Across the Web

upgrade asp.net core targeting framework 4.6.1 from ...
One or more compilation references are missing. Possible causes include a missing 'preserveCompilationContext' property under 'buildOptions' in ...
Read more >
Troubleshoot .NET Framework targeting errors
This article provides resolutions for MSBuild errors that might occur because of reference issues.
Read more >
Targeted .NET Frameworks - Visual Studio (Windows)
When you open a project that targets an earlier framework version, Visual Studio can automatically upgrade the project or leave the target as-is ......
Read more >
Building a project that target .NET Framework 4.5 in Visual ...
So, the fix is simple: just copy the files from that package to C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4 ...
Read more >
.NET core vs .NET framework
Wondering about the difference between .NET Core & .NET Framework? Here's a quick guide on how to pick the right runtime environment for...
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