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.

DbContext Model menu actions cause FileNotFoundException - Microsoft.VisualStudio.ProjectSystem, Version=16.0.0.0

See original GitHub issue

Hello, I’m having problems using the diagram building functionality and this library overall for the first time.

Steps to reproduce

Right click the project that contains class inheriting from DbContext -> EF Core Power Tools -> Add DbContext Model Diagram. VS builds the project and then displays an error in output window.

Further technical details

EF Core Power Tools version: latest build from feed (2.2.60)

.NET version: Core 2.2

Error message in output window:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.ProjectSystem, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.VisualStudio.ProjectSystem, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at EFCorePowerTools.Extensions.ProjectExtensions.GetCspProperty(Project project, String propertyName)
   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 94
   at EFCorePowerTools.Handlers.ModelAnalyzerHandler.Generate(String outputPath, Project project, GenerationType generationType) in C:\projects\efcorepowertools\src\GUI\EFCorePowerTools\Handlers\ModelAnalyzerHandler.cs:line 62

Database engine: Postgres

Visual Studio version: Visual Studio 2017 15.9.11 (latest).

I’ve tried installing ProjectSystem 16.0.374-pre via NuGet in the project i’ve tried to use EFCorePowerTools with, but to no avail. Same version is used in current EFCorePowerTools code version, but the current version of the source code seems to be different from the one in the latest build from the feed (e.g. line numbers in stack trace don’t match the current code line numbers).

I am very confused at the moment, am I missing something?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:29 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
SanjayForGitHubcommented, Jul 22, 2019

I downloaded your latest daily build an hour back and run it.

I have two class library projects, One is domain and another one is Application layer and these class library projects are added in my asp.net core website(Model-View-Controller).

In application layer, I have a class for DbContext, see below and from Application project I am clicking on Add DbContent Model diagram, getting errors.

System.NullReferenceException: Object reference not set to an instance of an object. at EFCorePowerTools.Extensions.ProjectExtensions.GetCspProperty(Project project, String propertyName) in C:\projects\efcorepowertools\src\GUI\EFCorePowerTools\Extensions\ProjectExtensions.cs:line 51 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 94 at EFCorePowerTools.Handlers.ModelAnalyzerHandler.Generate(String outputPath, Project project, GenerationType generationType) in C:\projects\efcorepowertools\src\GUI\EFCorePowerTools\Handlers\ModelAnalyzerHandler.cs:line 62

using Microsoft.EntityFrameworkCore; using Sandbox.Domain; using System;

namespace Sandbox.Application { public class EmployeeDbContext:DbContext { public EmployeeDbContext() { } public DbSet<Person> Person{ get; set; } public DbSet<Employee> Employee { get; set; } } }

1reaction
ErikEJcommented, Jul 22, 2019

I have now force added the dll in the latest daily build.

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 projects ......
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