Skip to content

Npgsql PostgreSQL Integration Extension - Could not load file or assembly 'Microsoft.VisualStudio.Shell.15.0'  #2897

Closed

Description

@aishwary08

Steps to reproduce

  1. Install Npgsql PostgreSQL Integration
  2. Open Visual Studio
  3. Getting following error
    Error

The issue

Exception message:
Stack trace: 
CreateInstance failed for package [NpgsqlVSPackage]Source: 'mscorlib' Description:
Could not load file or assembly 'Microsoft.VisualStudio.Shell.15.0, Version=16.0.0.0, 
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. 
The system cannot find the file specified. System.IO.FileNotFoundException: Could 
not load file or assembly 'Microsoft.VisualStudio.Shell.15.0, 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.Shell.15.0,
Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'  at
System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name,
Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type)   at
System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError,
Boolean ignoreCase)   at System.Activator.CreateInstanceFromInternal(String assemblyFile,
String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, 
Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)
at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName) WRN:
 Assembly binding logging is turned OFF. To enable assembly bind failure logging,
 set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to
 1. Note: There is some performance penalty associated with assembly bind failure
logging. To turn this feature off, remove the registry value 
[HKLM\Software\Microsoft\Fusion!EnableLog].
--

Further technical details

Npgsql version: 4.1.3
PostgreSQL version: 10.12
Operating system: Windows 10 Pro
IDE: Visual Studio Enterprise 2017

Activity

  1. added this to the Backlog milestone on May 13, 2020
  2. CGBMiguel commented on May 28, 2020

    @CGBMiguel

    I have de same problem, any solution?

  3. heinmulder commented on Jun 10, 2020

    @heinmulder

    Same here! Is there any status? Are there any consequenties in the use of VS 2017?

  4. CGBMiguel commented on Jun 10, 2020

    @CGBMiguel

    In VS 2019 work perfectly

  5. lopezcjf commented on Jul 2, 2020

    @lopezcjf

    Anyone found a solution for this?

  6. LuisTayupanda commented on Jul 7, 2020

    @LuisTayupanda

    Alguien ya encontro la solucion a este inconveniente en VS 2017?

  7. pmishkin commented on Jul 8, 2020

    @pmishkin

    Same issue here with VS2017 at least

  8. harishbatchu commented on Oct 13, 2020

    @harishbatchu

    Same issue here with VS2017

  9. agworkscode commented on Nov 5, 2020

    @agworkscode

    Same issue here with VS2017.

  10. Shanayara commented on Dec 8, 2020

    @Shanayara

    This specifically affects VS2017. Basically the Marketplace version is broken for that version.

    I have found a temporary fix: install the old .vsix from version 4.1.1 (later versions might work too, but there is no vsix file released for those on Github). Link: https://github.com/npgsql/npgsql/releases/download/v4.1.1/Npgsql.vsix

    I suspect that this commit here is to blame: 095476f

    According to #2670 (comment) this problem should be fixed, but perhaps that fix doesn't work anymore or @roji forgot to upload newer VS2017 compatible versions of the package to the Marketplace?

  11. roji commented on Apr 18, 2021

    @roji
    Member

    Closing as we no longer support the VSIX extension.

  12. gcapnias commented on Apr 20, 2021

    @gcapnias

    Is there an alternative to use PostgreSQL within the Visual Studio?

    Should I upgrade to Visual Studio to a newer version? Is there an alternative way to maintain existing database first code in .NET Framework v4.x?

    Thanks!

  13. roji commented on Apr 20, 2021

    @roji
    Member

    Unless I'm mistaken, @ErikEJ's Power Tools extension can do that. Otherwise you can keep using existing versions of the extension - we're just not updating or supporting it any more.

  14. 1 remaining item

  15. gcapnias commented on Apr 25, 2021

    @gcapnias

    @ErikEJ, The discussion is about maintaining existing .NET Framework code, based on database first model.

    I do use Power Tools for EF, both old and Core edition, but I am under the impression that a tool like SqlCeToolbox would be needed to replace Npgsql PostgreSQL Integration Extension.

    Am I wrong?

    Regards,
    George J.

  16. ErikEJ commented on Apr 25, 2021

    @ErikEJ
    Contributor

    @gcapnias yes, you are! 😁
    EF Core Power Tools supports SQLite, Firebird and SQL Azure MFA without DDEX/VS integration. If needed, I can also include PostgreSQL in that bucket, but I was under the impression that a DDEX provider for VS 2019 existed...

  17. roji commented on Apr 25, 2021

    @roji
    Member

    @ErikEJ an Npgsql DDEX provider existed, but we no longer really support it; the existing (older) versions should work just fine, but if someone needs to use a newer version of Npgsql for some reason, that wouldn't be possible.

  18. ErikEJ commented on Apr 25, 2021

    @ErikEJ
    Contributor

    @roji I just use the connection string from the DDEX provider, nothing else..

  19. roji commented on Apr 25, 2021

    @roji
    Member

    Well, the thing is that people have had various issues with making the VSIX work correctly (that's part of the reason I ended up not supporting it), so if everything could work without DDEX that would be even better :)

  20. ErikEJ commented on Apr 25, 2021

    @ErikEJ
    Contributor

    OK! I will add support for Npgsql without DDEX then in the next release of EF Core Power Tools

  21. roji commented on Apr 25, 2021

    @roji
    Member

    Thanks @ErikEJ!

  22. ErikEJ commented on Apr 25, 2021

    @ErikEJ
    Contributor

    Fixed in latest daily build

  23. roji commented on Apr 25, 2021

    @roji
    Member

    That was... faster than this discussion, which was already pretty fast :)

  24. gcapnias commented on Apr 25, 2021

    @gcapnias

    I am overwhelmed as well, but not quite convinced how EF Core Tools, are going to work with visual Studio 2017/2019 .edmx designers. I believe that a DDEX provider should be in place, in order existing designers to work.

    I do use SqlCeToolbox in order to maintain 10 years old code based on Sql Compact v3.5 & v4.0, which thanks to SqlCeToolbox I converted from EF 5.x to EF.6.x.

    George J.

  25. ErikEJ commented on Apr 25, 2021

    @ErikEJ
    Contributor

    As you can see form the changes it was a very simple change

    @gcapnias This change only relates to EF Core Power Tools! Nothing to do with .edmx and EF6.

  26. gcapnias commented on Apr 25, 2021

    @gcapnias

    :-)

    I know, I am grateful for including PostgreSQL in EF Core Tools, it will be a push to create applications in .NET Core for me.

    My disagreement about shutting down VSIX, was about loosing support of existing tools in current versions of Visual Studio.

    There is code, using .NET Framework 4.x (EF 5.x/EF 6.x), currently in production, working just fine. From time to time, there are minor hotfixes to be implemented - changes is database schema, that have to reflect in application code. If VSIX/DDEX support goes away, existing EF toolchain breaks. No-one will be able using EF 6.x designers to update EF DbContext; there is no other tool to update existing .edmx files.

    One cannot migrate all code in .NET Core and EF Core.

    I believe, it needs to exist basic support for PostgreSQL in order to keep existing toolchain running under VS2019, at least. I do understand shutting down VSIX/DDEX, with an eye looking forward. But, with the other eye, is just like forgetting what brought us here...

    Old code has to live too... That why I was talking moving DDEX support in SqlCeToolbox.

    George J.

  27. ErikEJ commented on Apr 25, 2021

    @ErikEJ
    Contributor

    @gcapnias got it, and SQL CE Toolbox includes primitive DDEX providers for SQLite and SQL CE 4.

    But Postgress does not really relate to SQL Compact Toolbox.

    @roji Was the VSIX source removed from this repo at some point? I could revive just enough of it to use with EF6 wizard, perhaps.

  28. roji commented on Apr 25, 2021

    @roji
    Member

    @gcapnias in a nutshell, old code indeed has to live too - but you can't expect all the tools you're using to continue supporting you in their latest versions. As I wrote above, it's perfectly fine to use the already-existing versions of the VSIX (versions 4.0 and 4.1); no support is lost, and the VSIX should work in VS2019. If a critical Npgsql bugfix is needed I can even produce new patch versions for these. But requiring Npgsql to forever support .NET Framework and the VSIX so that old applications can work with the newest versions of the driver does not seem reasonable.

    For background, supporting the VSIX was quite an attention drag, since the way things worked made it difficult to get things consistently right and almost impossible to debug when users hit into problems. Nobody from the community was particularly interested in stepping up, so eventually we decided to not keep spending the time on it.

    @ErikEJ you can look at any of the v4.1 release tags to see the source code for the VSIX.

  29. roji commented on Jun 23, 2022

    @roji
    Member

    FYI in case it's relevant, I've just release v4.1.12 of the VSIX which adds VS2022 support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions