Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BuildVision fails when VS loads a solution #97

Closed
ghost opened this issue May 12, 2020 · 20 comments
Closed

BuildVision fails when VS loads a solution #97

ghost opened this issue May 12, 2020 · 20 comments
Assignees
Labels

Comments

@ghost
Copy link

ghost commented May 12, 2020

I'm running a fresh install of VS 2019 Professional version 16.5.4.
BuildVision 3.0.0.104 is installed.

On loading a solution while VS starts, I get a popup "The 'BuildVisionPackage' package did not correctly. The problem may have been caused by a configuration change or the installation of another extension. You can get more information by examining the file \ActivityLog.xml. Restarting Visual Studio could help to resolve this issue. Continue to show this error message?"

Restarting VS or Windows didn't help, the error reoccurred. The solution is on .NET Framework 4.6.1.

The log contains the following error:

CreateInstance failed for package [BuildVisionPackage]Source: 'mscorlib' Description: Exception has been thrown by the target of an invocation.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'Serilog.LoggerConfiguration Serilog.FileLoggerConfigurationExtensions.File(Serilog.Configuration.LoggerSinkConfiguration, System.String, Serilog.Events.LogEventLevel, System.String, System.IFormatProvider, System.Nullable`1<Int64>, Serilog.Core.LoggingLevelSwitch, Boolean, Boolean, System.Nullable`1<System.TimeSpan>, Serilog.RollingInterval, Boolean, System.Nullable`1<Int32>, System.Text.Encoding)'.
   at BuildVision.Common.Logging.LogManager.CreateLogger()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at System.Lazy`1.get_Value()
   at BuildVision.Common.Logging.LogManager.ForContext(Type type)
   at BuildVision.Common.Logging.LogManager.ForContext[T]()
   at BuildVision.Core.BuildVisionPackage..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   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)System.MissingMethodException: Method not found: 'Serilog.LoggerConfiguration Serilog.FileLoggerConfigurationExtensions.File(Serilog.Configuration.LoggerSinkConfiguration, System.String, Serilog.Events.LogEventLevel, System.String, System.IFormatProvider, System.Nullable`1<Int64>, Serilog.Core.LoggingLevelSwitch, Boolean, Boolean, System.Nullable`1<System.TimeSpan>, Serilog.RollingInterval, Boolean, System.Nullable`1<Int32>, System.Text.Encoding)'.
   at BuildVision.Common.Logging.LogManager.CreateLogger()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at System.Lazy`1.get_Value()
   at BuildVision.Common.Logging.LogManager.ForContext(Type type)
   at BuildVision.Common.Logging.LogManager.ForContext[T]()
   at BuildVision.Core.BuildVisionPackage..ctor()
@thoemmi
Copy link

thoemmi commented Jul 21, 2020

I'm experiencing the same error with VS 2019 Preview (16.7.0 Preview 4) and BuildVision 3.0.1.13:

CreateInstance failed for package [BuildVisionPackage]Source: 'mscorlib' Description: Exception has been thrown by the target of an invocation.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'Serilog.LoggerConfiguration Serilog.FileLoggerConfigurationExtensions.File(Serilog.Configuration.LoggerSinkConfiguration, System.String, Serilog.Events.LogEventLevel, System.String, System.IFormatProvider, System.Nullable`1<Int64>, Serilog.Core.LoggingLevelSwitch, Boolean, Boolean, System.Nullable`1<System.TimeSpan>, Serilog.RollingInterval, Boolean, System.Nullable`1<Int32>, System.Text.Encoding, Serilog.Sinks.File.FileLifecycleHooks)'.
   at BuildVision.Common.Logging.LogManager.CreateLogger()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at System.Lazy`1.get_Value()
   at BuildVision.Common.Logging.LogManager.ForContext(Type type)
   at BuildVision.Core.BuildVisionPackage..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   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)System.MissingMethodException: Method not found: 'Serilog.LoggerConfiguration Serilog.FileLoggerConfigurationExtensions.File(Serilog.Configuration.LoggerSinkConfiguration, System.String, Serilog.Events.LogEventLevel, System.String, System.IFormatProvider, System.Nullable`1<Int64>, Serilog.Core.LoggingLevelSwitch, Boolean, Boolean, System.Nullable`1<System.TimeSpan>, Serilog.RollingInterval, Boolean, System.Nullable`1<Int32>, System.Text.Encoding, Serilog.Sinks.File.FileLifecycleHooks)'.
   at BuildVision.Common.Logging.LogManager.CreateLogger()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at System.Lazy`1.get_Value()
   at BuildVision.Common.Logging.LogManager.ForContext(Type type)
   at BuildVision.Core.BuildVisionPackage..ctor()

@StefanKert StefanKert reopened this Jul 23, 2020
@StefanKert
Copy link
Owner

Hi @thoemmi ,

that is pretty weird. I am currently not able to reproduce this issue. Could you add a screenshot of your BuildVision Installdir? You should find it depending on your Visual Studio version in the Local AppData folder. For me the path is

%localappdata%\Microsoft\VisualStudio\16.0_85623757\Extensions\e4jutkrq.cnx

If you have installed just a single verison of Visual just head to

%localappdata%\Microsoft\VisualStudio\

Navigate to the folder for your current visual studio version and then to extensions. In this folder you have multiple installed extensions and the name is chosen randomly so you will have to check each. I will add an option to BuildVision to go there directly in the next version but for now this is probably the easiest way. For me it looks like this:

image

Thanks a lot 👍

@thoemmi
Copy link

thoemmi commented Jul 23, 2020

@StefanKert , here's a screenshot of BuildVision's installdir, including the version columns:
image

The strange is that it only happens when I open certain solutions. I just haven't recognized any pattern yet.

@yuakihiro
Copy link

Because of GitHub Extension or so.
DLL Version Conflict
see serilog/serilog-sinks-file#159

@OzBob
Copy link

OzBob commented Aug 11, 2020

I've got v 3.0.1.13 on VS 2019 16.6.2 and am getting the same error:

  <entry>
    <record>989</record>
    <time>2020/08/11 02:38:27.202</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>CreateInstance failed for package [BuildVisionPackage]Source: 'mscorlib' Description: Exception has been thrown by the target of an invocation.
;System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&gt; System.MissingMethodException: Method not found: 'Serilog.LoggerConfiguration Serilog.FileLoggerConfigurationExtensions.File(Serilog.Configuration.LoggerSinkConfiguration, System.String, Serilog.Events.LogEventLevel, System.String, System.IFormatProvider, System.Nullable`1&lt;Int64&gt;, Serilog.Core.LoggingLevelSwitch, Boolean, Boolean, System.Nullable`1&lt;System.TimeSpan&gt;, Serilog.RollingInterval, Boolean, System.Nullable`1&lt;Int32&gt;, System.Text.Encoding, Serilog.Sinks.File.FileLifecycleHooks)'.
;   at BuildVision.Common.Logging.LogManager.CreateLogger()
...
;   at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)System.MissingMethodException: Method not found: 'Serilog.LoggerConfiguration Serilog.FileLoggerConfigurationExtensions.File(Serilog.Configuration.LoggerSinkConfiguration, System.String, Serilog.Events.LogEventLevel, System.String, System.IFormatProvider, System.Nullable`1&lt;Int64&gt;, Serilog.Core.LoggingLevelSwitch, Boolean, Boolean, System.Nullable`1&lt;System.TimeSpan&gt;, Serilog.RollingInterval, Boolean, System.Nullable`1&lt;Int32&gt;, System.Text.Encoding, Serilog.Sinks.File.FileLifecycleHooks)'.
;   at BuildVision.Common.Logging.LogManager.CreateLogger()
...
;   at BuildVision.Common.Logging.LogManager.ForContext(Type type)
;   at BuildVision.Core.BuildVisionPackage..ctor()</description>
    <guid>{837C3C3B-8382-4839-9C9A-807B758A929F}</guid>
    <hr>80004005 - E_FAIL</hr>
    <errorinfo></errorinfo>
  </entry>

image

No error on VS2019 preview 16.7.0 preivew 2.0 opening the same project, with the listing of it's directory as:
image

@yuakihiro
Copy link

@OzBob you also install github extension or other extension?
github extension have older assembly(dll) and conflict with BuildVision(newer assembly)

@thoemmi
Copy link

thoemmi commented Aug 11, 2020

I can confirm that GitHub's version of Serilog.dll ist out-dated.

I've run following command in both the user and the application extensions path:

gci serilog.* -Recurse | % { [pscustomobject]@{ Name=(Resolve-Path $_ -Relative); Version=[System.Diagnostics.FileVersionInfo]::GetVersionInfo($_).FileVersion }}

In the user extensions folder Serilog is only used by BuildVision:

Name                                         Version
----                                         -------
.\12klbayc.p2q\Serilog.dll                   2.9.0.0
.\12klbayc.p2q\Serilog.Enrichers.Process.dll 2.0.1.0
.\12klbayc.p2q\Serilog.Enrichers.Thread.dll  3.1.0.0
.\12klbayc.p2q\Serilog.Sinks.File.dll        4.1.0.0

However, in the application extension folder serilog is found in the subfolders of both GitHub and Xamarin:

Name                                          Version
----                                          -------
.\GitHub\GitHub\Serilog.dll                   2.5.0.0
.\GitHub\GitHub\Serilog.Enrichers.Process.dll 2.0.1.0
.\GitHub\GitHub\Serilog.Enrichers.Thread.dll  3.0.0.0
.\GitHub\GitHub\Serilog.Sinks.File.dll        3.2.0.0
.\Xamarin.VisualStudio\hotrestart\Serilog.dll 2.8.0.0

@StefanKert
Copy link
Owner

Hi folks!

Thanks for the detailed analysis of this issue :). This really saved me some time. I just created a .vsix package with a downgraded Serilog version. I am currently not able to reproduce it, so if somebody that is facing this issue could check it I´d greatly appreciate it :).

BuildVision_3_0_2_preview.zip

@StefanKert StefanKert self-assigned this Aug 11, 2020
@Anheledir
Copy link

Anheledir commented Aug 13, 2020

I can confirm that the exception is gone for me with that 3.0.2 preview (on VS2019) 👍

@ktopanov
Copy link

I can confirm that the exception is gone for me with that 3.0.2 preview (MS Visual Studio 2017).

@thoemmi
Copy link

thoemmi commented Aug 14, 2020

I have not experienced the issue w/ 3.0.2 in VS2019 Preview anymore, too. 👍

@ghost
Copy link
Author

ghost commented Aug 14, 2020

Installed that 3.0.2 preview, so far no more errors

@StefanKert
Copy link
Owner

Thanks for testing folks!

I´ll try to bring in another fix (#103) and release 3.0.2 by the end of this week.

@EugeneSasin
Copy link

Hello! The bug is back. I once caught this error when I was using the latest (3.1.0) version.
I installed versions 3.0.2 and 2.1.1 and the bug was fixed the first time I started VS. But it returned after restarting VS. I use VS 2017
image

@OzBob
Copy link

OzBob commented Apr 29, 2022

@EugeneSasin can you try installing and testing on VS2022

@OzBob
Copy link

OzBob commented Apr 29, 2022

#112
" v3.1.0 with VS 2022 support has just been pushed to the Marketplace."
" Any feedback is greatly appreciated. If you have troubles setting up the VSIX Gallery in VS checkout this guide https://github.com/StefanKert/BuildVision#preview-builds-for-buildvision "

@hvanbrug
Copy link

I just re-installed this extension after a few years. I now am getting this same issue. I am using v3.1.0.7 on VS2022 v17.4.4. I do have an extension gallery set up for BuildVision, but there appears to not be anything newer yet. Is this being worked on? Please let me know if I can get you more details.

@kevinbabcock
Copy link

I just re-installed this extension after a few years. I now am getting this same issue. I am using v3.1.0.7 on VS2022 v17.4.4. I do have an extension gallery set up for BuildVision, but there appears to not be anything newer yet. Is this being worked on? Please let me know if I can get you more details.

Same. Just installed it after several years and getting this error. I am on BuildVision v3.1.0.7 and VS 2022 Enterprise 17.8.1.

Here's the error that is logged after trying to load the extension:

SetSite failed for package [BuildVisionPackage]Source: 'Microsoft.VisualStudio.Validation' Description: Cannot find an instance of the Microsoft.VisualStudio.Shell.Interop.IVsSolutionBuildManager5 service.

@StefanKert
Copy link
Owner

Hi folks,

so I believe that this is fixed in the upcoming 4.0.0 release. You can grab the latest release from the VSIXGallery https://github.com/stefankert/buildvision?tab=readme-ov-file#setup-visual-studio-for-preview-channel. I will close this issue since it is right now hard to keep trackof the different "vs 2022 not working" issues, so if there are still issues with the vsix please create another issue. Thank you very much

@gabriel-vanca
Copy link

Can confirm v4 fixes the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants