TfsPendingChangesMargin icon indicating copy to clipboard operation
TfsPendingChangesMargin copied to clipboard

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

Open DanielTheCoder opened this issue 9 years ago • 20 comments

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.<AddMargins>b__25_1(IWpfTextViewMarginProvider mp) at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension,TMetadata,TExtensionInstance](Object errorSource, Lazy2 provider, Func2 getter)

DanielTheCoder avatar Jul 16 '15 21:07 DanielTheCoder

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

M-Zuber avatar Jul 21 '15 11:07 M-Zuber

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.<GetMarginCore>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.<AddMargins>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.

ChrisTorng avatar Jul 24 '15 02:07 ChrisTorng

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

M-Zuber avatar Oct 19 '15 05:10 M-Zuber

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

ChrisTorng avatar Oct 20 '15 03:10 ChrisTorng

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 avatar Oct 20 '15 04:10 M-Zuber

Here is a better version thanks to @mika76

M-Zuber avatar Oct 20 '15 13:10 M-Zuber

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...

mika76 avatar Oct 20 '15 16:10 mika76

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 avatar Oct 20 '15 17:10 M-Zuber

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

M-Zuber avatar Oct 20 '15 17:10 M-Zuber

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

mika76 avatar Oct 20 '15 17:10 mika76

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.

mika76 avatar Oct 20 '15 17:10 mika76

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

M-Zuber avatar Oct 20 '15 19:10 M-Zuber

Hmm found this conversation and then the packages here

mika76 avatar Oct 20 '15 21:10 mika76

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

M-Zuber avatar Oct 20 '15 22:10 M-Zuber

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

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

mika76 avatar Oct 20 '15 22:10 mika76

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

M-Zuber avatar Oct 20 '15 22:10 M-Zuber

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

mika76 avatar Oct 21 '15 07:10 mika76

Which of the four packages did you add?

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

M-Zuber avatar Oct 21 '15 07:10 M-Zuber

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

mika76 avatar Oct 21 '15 09:10 mika76

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)

M-Zuber avatar Oct 21 '15 09:10 M-Zuber