Skip to content
This repository has been archived by the owner on Mar 18, 2019. It is now read-only.

Extension crashing if specflow .feature file is opened in Visual Studio 2015 RC #12

Open
DanielTheCoder opened this issue Jul 16, 2015 · 20 comments

Comments

@DanielTheCoder
Copy link

Extension is crashing when opening a specflow .feature file is opened in Visual Studio 2015 RC.

https://github.com/techtalk/SpecFlow

Microsoft.CSharp.RuntimeBinder.RuntimeBinderInternalCompilerException: An unexpected exception occurred while binding a dynamic operation at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.Bind(DynamicMetaObjectBinder payload, IEnumerable1 parameters, DynamicMetaObject[] args, DynamicMetaObject& deferredBinding) at Microsoft.CSharp.RuntimeBinder.BinderHelper.Bind(DynamicMetaObjectBinder action, RuntimeBinder binder, IEnumerable1 args, IEnumerable1 arginfos, DynamicMetaObject onBindingError) at Microsoft.CSharp.RuntimeBinder.CSharpConvertBinder.FallbackConvert(DynamicMetaObject target, DynamicMetaObject errorSuggestion) at System.Dynamic.DynamicMetaObject.BindConvert(ConvertBinder binder) at System.Dynamic.ConvertBinder.Bind(DynamicMetaObject target, DynamicMetaObject[] args) at System.Dynamic.DynamicMetaObjectBinder.Bind(Object[] args, ReadOnlyCollection1 parameters, LabelTarget returnLabel) at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T](CallSite1 site, Object[] args) at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) at AlekseyNagovitsyn.TfsPendingChangesMargin.MarginCore..ctor(IWpfTextView textView, ITextDocumentFactoryService textDocumentFactoryService, SVsServiceProvider vsServiceProvider, IEditorFormatMapService formatMapService, IScrollMapFactoryService scrollMapFactoryService) at AlekseyNagovitsyn.TfsPendingChangesMargin.MarginCoreFactory.<>c__DisplayClass1.<GetMarginCore>b__0() at Microsoft.VisualStudio.Utilities.PropertyCollection.GetOrCreateSingletonProperty[T](Object key, Func1 creator) at AlekseyNagovitsyn.TfsPendingChangesMargin.MarginCoreFactory.GetMarginCore(IWpfTextViewHost textViewHost) at AlekseyNagovitsyn.TfsPendingChangesMargin.ScrollbarMarginFactory.CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin marginContainer) at Microsoft.VisualStudio.Text.Utilities.ContainerMargin.b__25_1(IWpfTextViewMarginProvider mp) at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension,TMetadata,TExtensionInstance](Object errorSource, Lazy2 provider, Func2 getter)

@DanielTheCoder DanielTheCoder changed the title Extension crashing if specflow .feature file is opened Extension crashing if specflow .feature file is opened in Visual Studio 2015 RC Jul 17, 2015
@M-Zuber
Copy link

M-Zuber commented Jul 21, 2015

This is happening to me simply when running VS 2015 RTM.

I do have the Specflow extension installed, and a few .feature files in the project, but the extension was crashing during a clean load of the project, without me opening any files

@ChrisTorng
Copy link

I don't have Specflow extension. While opening files, VS 2015 RTM won't crash. just shows errors happen, log in ActivityLog.xml. I've seen two kind of exceptions, one is the original, the other is following:

Microsoft.CSharp.RuntimeBinder.RuntimeBinderInternalCompilerException: An unexpected exception occurred while binding a dynamic operation
at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.Bind(DynamicMetaObjectBinder payload, IEnumerable'1 parameters, DynamicMetaObject[] args, DynamicMetaObject& deferredBinding)
at Microsoft.CSharp.RuntimeBinder.BinderHelper.Bind(DynamicMetaObjectBinder action, RuntimeBinder binder, IEnumerable'1 args, IEnumerable'1 arginfos, DynamicMetaObject onBindingError)
at Microsoft.CSharp.RuntimeBinder.CSharpConvertBinder.FallbackConvert(DynamicMetaObject target, DynamicMetaObject errorSuggestion)
at System.Dynamic.DynamicMetaObject.BindConvert(ConvertBinder binder)
at System.Dynamic.ConvertBinder.Bind(DynamicMetaObject target, DynamicMetaObject[] args)
at System.Dynamic.DynamicMetaObjectBinder.Bind(Object[] args, ReadOnlyCollection'1 parameters, LabelTarget returnLabel)
at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T](CallSite'1 site, Object[] args)
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
at AlekseyNagovitsyn.TfsPendingChangesMargin.MarginCore..ctor(IWpfTextView textView, ITextDocumentFactoryService textDocumentFactoryService, SVsServiceProvider vsServiceProvider, IEditorFormatMapService formatMapService, IScrollMapFactoryService scrollMapFactoryService)
at AlekseyNagovitsyn.TfsPendingChangesMargin.MarginCoreFactory.<>c__DisplayClass1.b__0()
at Microsoft.VisualStudio.Utilities.PropertyCollection.GetOrCreateSingletonProperty[T](Object key, Func'1 creator)
at AlekseyNagovitsyn.TfsPendingChangesMargin.MarginCoreFactory.GetMarginCore(IWpfTextViewHost textViewHost)
at AlekseyNagovitsyn.TfsPendingChangesMargin.EditorMarginFactory.CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin marginContainer)
at Microsoft.VisualStudio.Text.Utilities.ContainerMargin.b__25_1(IWpfTextViewMarginProvider mp)
at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension,TMetadata,TExtensionInstance](Object errorSource, Lazy'2 provider, Func'2 getter)

The only difference to original post is ScrollbarMarginFactory change to ScrollbarMarginFactory.
Disable TfsPendingChangesMargin solve this problem.

@M-Zuber
Copy link

M-Zuber commented Oct 19, 2015

Here is a release that works with 2015.
The issue had nothing to do with SpecFlow

@ChrisTorng
Copy link

Can you give us the installer? I don't have Visual Studio Extensibility Tools installed so can't build the solution.

@M-Zuber
Copy link

M-Zuber commented Oct 20, 2015

I feel dumb.
My apologies, as soon as i get to that machine I will upload the visx to the release page linked above

@M-Zuber
Copy link

M-Zuber commented Oct 20, 2015

Here is a better version thanks to @mika76

@mika76
Copy link
Contributor

mika76 commented Oct 20, 2015

Not sure about better, all I did was to replace references with vs2015 ones. Should do a pull request? I have no idea what effect it'll have with 2013 though...

@M-Zuber
Copy link

M-Zuber commented Oct 20, 2015

What you did is better as you fixed a number of dll's. I only switched one
It will not work with 2013 as far as my testing goes

@M-Zuber
Copy link

M-Zuber commented Oct 20, 2015

One tip though - you used paths that are unique to your computer.
It might be better to use C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions - or whatever is relevant to a given dll - as the starting path

@mika76
Copy link
Contributor

mika76 commented Oct 20, 2015

Cool. I added it using the GUI so didn't even think about it really. Did you test it with vs2013?

@mika76
Copy link
Contributor

mika76 commented Oct 20, 2015

Oh I misread your previous comment. You did test and it will not work. I guess there will have to be 2 releases? I read somewhere Microsoft want to release these dll's as a nuget package.

@M-Zuber
Copy link

M-Zuber commented Oct 20, 2015

I don't remember hearing something about nuget's. But yes until such a time that such packages are released there will need to be two releases of the extension

@mika76
Copy link
Contributor

mika76 commented Oct 20, 2015

Hmm found this conversation and then the packages here

@M-Zuber
Copy link

M-Zuber commented Oct 20, 2015

So who tries them? me or you?
image
Also do you know specifically which packages we need?

@mika76
Copy link
Contributor

mika76 commented Oct 20, 2015

I can try no problem but it's late here currently so I will have a sleep and try in the morning 😄

Not sure - but it'll be trial-by-error I suppose

@M-Zuber
Copy link

M-Zuber commented Oct 20, 2015

Great.
Thank you.
I'll be around tomorrow if there is any help I can give

@mika76
Copy link
Contributor

mika76 commented Oct 21, 2015

Tried it. All references are supplied except for TeamFoundationServerExt - can't seem to find that class anywhere...

@M-Zuber
Copy link

M-Zuber commented Oct 21, 2015

Which of the four packages did you add?

Maybe you can commit the changes and I can download the files from your fork?

@mika76
Copy link
Contributor

mika76 commented Oct 21, 2015

I asked the question on stack overflow and there's an interesting discussion going on...

@M-Zuber
Copy link

M-Zuber commented Oct 21, 2015

Check out NuGet Package Explorer. In general it is a great tool. Either way, it's either a hard coded path to VS install location or reg key lookup
The advantage of the registry lookup solution is that you only need one visx?
Otherwise - if you install the extension for vs2015 then the dll's should be there no? So I see no issue with having the path hardcoded (per the path I suggested above)

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

No branches or pull requests

4 participants