axodox / AxoCover

Nice and free .Net code coverage support for Visual Studio with OpenCover.
https://marketplace.visualstudio.com/items?itemName=axodox1.AxoCover
MIT License
249 stars 60 forks source link

AxoCover window fails to load on solution with non-standard projects #186

Open euronay opened 5 years ago

euronay commented 5 years ago

Hi

I'm having an issue running AxoCover on a solution which has "non-standard" projects. Specifically, I have a solution with a number of projects and a Dotfuscator project (3rd party obfuscation). If I try and open the AxoCover window from Tools > AxoCover, I get the following error message: image

If I already have the AxoCover tool window open and then open the solution, it displays the following: image

If I remove the dotfuscator project, everything works fine. Does it simply need to ignore projects that are not .csproj (or .vbproj)?

I can reproduce the issue in a new solution. I have attached here: TestProj.zip

Many Thanks

James

The full error displayed is

An exception was encountered while constructing the content of this frame.  This information is also logged in "C:\Users\jamnay\AppData\Roaming\Microsoft\VisualStudio\15.0_0879e289\ActivityLog.xml".

Exception details:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Windows.Markup.XamlParseException: The invocation of the constructor on type 'AxoCover.Views.SettingsView' that matches the specified binding constraints threw an exception. ---> Microsoft.Practices.Unity.ResolutionFailedException: Resolution of the dependency failed, type = "AxoCover.ViewModels.SettingsViewModel", name = "(none)".
Exception occurred while: Calling constructor AxoCover.ViewModels.SettingsViewModel(AxoCover.Models.Editor.IEditorContext editorContext, AxoCover.Models.Storage.IStorageController storageController, AxoCover.Models.Testing.Execution.ITestRunner testRunner, AxoCover.Models.Telemetry.ITelemetryManager telemetryManager, AxoCover.Models.Storage.IOptions options, AxoCover.Models.Storage.IIoProvider ioProvider).
Exception is: COMException - Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))
-----------------------------------------------
At the time of the exception, the container was:

  Resolving AxoCover.ViewModels.SettingsViewModel,(none)
  Calling constructor AxoCover.ViewModels.SettingsViewModel(AxoCover.Models.Editor.IEditorContext editorContext, AxoCover.Models.Storage.IStorageController storageController, AxoCover.Models.Testing.Execution.ITestRunner testRunner, AxoCover.Models.Telemetry.ITelemetryManager telemetryManager, AxoCover.Models.Storage.IOptions options, AxoCover.Models.Storage.IIoProvider ioProvider)
 ---> System.Runtime.InteropServices.COMException: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Runtime.InteropServices.CustomMarshalers.EnumerableViewOfDispatch.GetEnumerator()
   at System.Collections.IEnumerable.GetEnumerator()
   at System.Linq.Enumerable.<OfTypeIterator>d__95`1.MoveNext()
   at AxoCover.Common.Extensions.GenericExtensions.<Flatten>d__9`1.MoveNext() in C:\projects\axotools\AxoCover.Common\Extensions\GenericExtensions.cs:line 111
   at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at AxoCover.Models.Toolkit.ObservableEnumeration`1.Refresh() in C:\projects\axotools\AxoCover\Models\Toolkit\ObservableEnumeration.cs:line 35
   at AxoCover.ViewModels.SettingsViewModel..ctor(IEditorContext editorContext, IStorageController storageController, ITestRunner testRunner, ITelemetryManager telemetryManager, IOptions options, IIoProvider ioProvider) in C:\projects\axotools\AxoCover\ViewModels\SettingsViewModel.cs:line 213
   at lambda_method(Closure , IBuilderContext )
   at Microsoft.Practices.ObjectBuilder2.DynamicBuildPlanGenerationContext.<>c__DisplayClass1.<GetBuildMethod>b__0(IBuilderContext context)
   at Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlan.BuildUp(IBuilderContext context)
   at Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context)
   at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)
   at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides)
   --- End of inner exception stack trace ---
   at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides)
   at Microsoft.Practices.Unity.UnityContainer.Resolve(Type t, String name, ResolverOverride[] resolverOverrides)
   at Microsoft.Practices.Unity.UnityContainerExtensions.Resolve[T](IUnityContainer container, ResolverOverride[] overrides)
   at AxoCover.Views.View`1..ctor() in C:\projects\axotools\AxoCover\Views\View.cs:line 17
   at AxoCover.Views.SettingsView..ctor() in C:\projects\axotools\AxoCover\Views\SettingsView.xaml.cs:line 27
   --- End of inner exception stack trace ---
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
   at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
   at AxoCover.Views.TestExplorerView.InitializeComponent() in C:\projects\axotools\AxoCover\Views\TestExplorerView.xaml:line 1
   at AxoCover.TestExplorerToolWindow..ctor() in C:\projects\axotools\AxoCover\TestExplorerToolWindow.cs:line 16
   --- 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.Activator.CreateInstance(Type type)
   at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, ProvideToolWindowAttribute tool)
   at Microsoft.VisualStudio.Shell.Package.FindToolWindow(Type toolWindowType, Int32 id, Boolean create, ProvideToolWindowAttribute tool)
   at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsToolWindowFactory.CreateToolWindow(Guid& toolWindowType, UInt32 id)
   at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()
axodox commented 5 years ago

Thanks, I no longer work actively on this plug-in, but I might close some issues during the holidays if I have some time.