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.

Multi Targetting Seems to have stopped working as workaround

See original GitHub issue

I have many times successfully created a DGML with a non-executable project by multi-targeting the project. For example, I would change a project that was originally targetting .NETStandard2.0 to:

<TargetFrameworks>netcoreapp3.0;netstandard2.0</TargetFrameworks>

Now (possibly result of a VS2019 update???) creating the DGML fails with a message that Microsoft.EntityFrameworkCore.dll cannot be found in the appliations’s bin/debug path. Example with my long path:

System.Exception: Unable to find Microsoft.EntityFrameworkCore.dll in folder C:\Users\jlerm\Downloads\getting-started-entity-framework-core\04\demos\M4 Relationships After\SamuraiApp\SamuraiApp.Data\bin\Debug\netcoreapp3.0.
   at EFCorePowerTools.Handlers.ProcessLauncher.GetEfCoreVersion(String folder) in C:\projects\efcorepowertools\src\GUI\EFCorePowerTools\Handlers\ProcessLauncher.cs:line 222
   at EFCorePowerTools.Handlers.ProcessLauncher.DropNetCoreFiles(String outputPath) in C:\projects\efcorepowertools\src\GUI\EFCorePowerTools\Handlers\ProcessLauncher.cs:line 244
   at EFCorePowerTools.Handlers.ProcessLauncher.GetOutput(String outputPath, String projectPath, GenerationType generationType, String contextName, String migrationIdentifier, String nameSpace) in C:\projects\efcorepowertools\src\GUI\EFCorePowerTools\Handlers\ProcessLauncher.cs:line 64
   at EFCorePowerTools.Handlers.ModelAnalyzerHandler.Generate(String outputPath, Project project, GenerationType generationType) in C:\projects\efcorepowertools\src\GUI\EFCorePowerTools\Handlers\ModelAnalyzerHandler.cs:line 67

I can follow Karl Shifflet’s workaround (https://github.com/ErikEJ/EFCorePowerTools/issues/451) successfully, however I cannot understand why multi-targeting is no longer working. I am using a project on the same computer that I have successfully created the dgml with many times. This seems to be the problem a number of people following my EF Core course are hitting.

##Repro Repo https://github.com/julielerman/Demo-Solution-Set-up-for-EF-Core-Power-Tools-Testing

Further technical details

EF Core Power Tools version: 2.4.212 (must have auto updated just today)

Database engine: SQL Server Localdb

Visual Studio version: VS 2019 16.7.2

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
ErikEJcommented, Sep 17, 2020

Will let you know tomorrow if it is an easy fix - one possibility is to disable support for EF Core 5 for now.

0reactions
julielermancommented, Sep 17, 2020

I will be crossing my fingers. I don’t want to make your life harder.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build errors when multi-targeting in csproj file
To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework...
Read more >
Running into issues when multi targeting project
I am hitting some weird issues when setting up my project to target both .net framework and core. I am able to compile...
Read more >
Troubleshoot .NET Framework targeting errors
To resolve the error, make sure that your application targets a .NET version that's compatible with the version that's targeted by the ...
Read more >
Source generators run very unreliably (especially with multi ...
IntelliSense not working correctly (red squiggly lines all over the place for generated members); Builds outright being broken with various ...
Read more >
Multi-Targeting and Porting a .NET Library to .NET Core 2.0
I 've been holding off porting any of my full frameworks to .NET Core. With the latest .NET Core 2.0 and .NET Standard...
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