Bug #103894 MySQL for Visual Studio fails to load on Microsoft Visual Studio
Submitted: 2 Jun 15:05 Modified: 2 Jul 12:05
Reporter: Guillermo Garcia Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Visual Studio Integration Severity:S3 (Non-critical)
Version: 1.2.9 OS:Microsoft Windows (10.0.19042 Build 19042)
Assigned to: CPU Architecture:x86 (Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz, 2112 Mhz, 4 Core(s), 8 Logical Processor(s))
Tags: mysql for visual studio

[2 Jun 15:05] Guillermo Garcia
Description:
On fresh installations of Microsoft Visual Studio Community 2019 (Version 16.10.0) and MySQL for Visual Studio 1.2.9, whenever I try to create a new MySQL script I get "The 'MySQL for Visual Studio 1.2.9' package did not load correctly. The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file ...\ActivityLog.xml'. Restarting Visual Studio could help resolve this issue."

I tried restarting and reinstalling the MySQL extension, with no success.

Below an extract of the ActivityLog.xml.

  <entry>
    <record>946</record>
    <time>2021/06/02 14:57:00.810</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Begin package load [MySQL for Visual Studio 1.2.9]</description>
    <guid>{79A115C9-B133-4891-9E7B-242509DAD272}</guid>
  </entry>
  <entry>
    <record>947</record>
    <time>2021/06/02 14:57:00.812</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>CreateInstance failed for package [MySQL for Visual Studio 1.2.9]Source: &apos;mscorlib&apos; Description: Exception has been thrown by the target of an invocation.&#x000D;&#x000A;System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&gt; System.Exception: Creating second instance of package&#x000D;&#x000A;   at MySql.Data.VisualStudio.MySqlDataProviderPackage..ctor()&#x000D;&#x000A;   --- End of inner exception stack trace ---&#x000D;&#x000A;   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean&amp; canBeCached, RuntimeMethodHandleInternal&amp; ctor, Boolean&amp; bNeedSecurityCheck)&#x000D;&#x000A;   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark&amp; stackMark)&#x000D;&#x000A;   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark&amp; stackMark)&#x000D;&#x000A;   at System.Activator.CreateInstance(Type type, Boolean nonPublic)&#x000D;&#x000A;   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark&amp; stackMark)&#x000D;&#x000A;   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)&#x000D;&#x000A;   at System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)&#x000D;&#x000A;   at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)System.Exception: Creating second instance of package&#x000D;&#x000A;   at MySql.Data.VisualStudio.MySqlDataProviderPackage..ctor()</description>
    <guid>{79A115C9-B133-4891-9E7B-242509DAD272}</guid>
    <hr>80004005 - E_FAIL</hr>
    <errorinfo></errorinfo>
  </entry>
</activity>

The versions installed of Visual Studio.

Microsoft Visual Studio Community 2019
Version 16.10.0
VisualStudio.16.Release/16.10.0+31321.278
Microsoft .NET Framework
Version 4.8.04084

Installed Version: Community

C# Tools   3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Cookiecutter   16.10.21111.19
Provides tools for finding, instantiating and customizing templates in cookiecutter format.

NuGet Package Manager   5.10.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

Python   16.10.21111.19
Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.

Python - Profiling support   16.10.21111.19
Profiling support for Python projects.

Visual Basic Tools   3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

How to repeat:
Install
Microsoft Visual Studio Community 2019 (Version 16.10.0)
MySQL for Visual Studio 1.2.9
Open Microsoft Visual Studio Community 2019.
File -> New -> File -> MySQL -> MySQL script -> Open.
[2 Jul 12:05] MySQL Verification Team
Hello Guillermo Garcia,

Thank you for the bug report.
I tried to reproduce your issue on windows 10 with MySQL Visual Studio 2019 and MySQL for Visual Studio 1.2.9 but I am not seeing any issues at my end. 

Regards,
Ashwini Patil