BuildVision: BuildVision fails when VS loads a solution
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 <path hidden>\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()
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 17 (3 by maintainers)
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
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:
In the user extensions folder Serilog is only used by BuildVision:
However, in the application extension folder serilog is found in the subfolders of both GitHub and Xamarin:
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
Thanks for testing folks!
I´ll try to bring in another fix (#103) and release 3.0.2 by the end of this week.