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

VS2015 - Can't run tests because COMException was unhandled #534

Closed
RobertAFTurner opened this issue Dec 17, 2015 · 41 comments
Closed

VS2015 - Can't run tests because COMException was unhandled #534

RobertAFTurner opened this issue Dec 17, 2015 · 41 comments

Comments

@RobertAFTurner
Copy link

I have recently upgraded to Visual Studio 2015 Update 1

After going through a few necessary steps to get it compiling, any test I try to run seems to abort almost immidietly. On debugging the tests I seem to hit this exception every time.

image

Did I miss a step when upgrading? Am I doing anything wrong? I have these NuGet packages installed.
image

To be sure it wasn't part of my current test solution that I am maintaining, I created a brand new solution with a test project in. And wrote a simple test which threw the exact same exception.

Any response would be greatly appreciated.

Kind Regards,
Rob

@RobertAFTurner
Copy link
Author

As a side note. The tests still work fine in Visual Studio 2013

@samholder
Copy link
Contributor

just out of interest, have you rebooted since the upgrade?

@RobertAFTurner
Copy link
Author

Hi, thanks for your reply. I have tried that yes I'm afraid.

@jonparker
Copy link

I am also getting the same error using VS2015 Update1.

@simoncalvin
Copy link

Happening here, too. Would the crash dump be of any use?

@samholder
Copy link
Contributor

I expect this is actually an issue for the extension and not specflow itself. https://github.com/techtalk/SpecFlow.VisualStudio

Don't think the crash dump is going to be much use (at least wouldn't help me much). it needs someone to look at the issue in the debugger I expect. I might have time over the weekend, but no guarantees. Anyone who has the issue could grab the source for the extension and build it and run through a debugger and see if it is something obvious.

@simoncalvin
Copy link

It makes sense that this would have to do with the extension. I gave debugging a whirl and came up with a big mess of exceptions in external code. I can't makes heads or tails of it. Maybe someone with experience debugging VS extensions will have better luck.

@samholder
Copy link
Contributor

Hmm...

I have just tried to repro this. I had installed vs2015, but did not have the specflow extension installed. I updated vs2015 to update 1, then installed the extension and it all seems to work ok.

Have you tried removing the extension and readding it?

@RobertAFTurner
Copy link
Author

Hi Sam thanks for checking this out.

If I get a chance later today i will remote into my work machine and try reinstalling the extension, but I don't know if it will help because we went straight to VS2015.1 there was never a 2015 install on my computer without Update 1 installed either. Could be an issue that only occurs for people that installed Update 1 and VS2015 during the same install?

@samholder
Copy link
Contributor

I tested on windows ten at home. I know someone at will had a similar issue
on windows 7 (navigating to step definitions rather than running tests) so
it would be useful to know what os you had the issue on
On 19 Dec 2015 10:09 a.m., "RobertAFTurner" notifications@github.com
wrote:

Hi Sam thanks for checking this out.

If I get a chance later today i will remote into my work machine and try
reinstalling the extension, but I don't know if it will help because we
went straight to VS2015.1 there was never a 2015 install on my computer
without Update 1 installed either. Could be an issue that only occurs for
people that installed Update 1 and VS2015 during the same install?


Reply to this email directly or view it on GitHub
#534 (comment).

@RobertAFTurner
Copy link
Author

I was using Windows 8.1

@jonparker
Copy link

I'm using windows 7 and originally had just vs2015 installed.

@rushalias
Copy link

I followed the recommended steps of uninstalling and installing specflow extension, but I am still unable to run any spec flow tests. Here is what I am getting when I try to run a specflow test:
========== Discover test finished: 435 found (0:00:01.6855299) ==========
------ Run test started ------
SpecRun Evaluation Mode: Please purchase at http://specrun.com to remove test execution delay.
SpecRun: running tests in C:\MyApps\ot\user-service\AcceptanceTests\bin\Debug\AcceptanceTests.dll
Profile: Default
The active Test Run was aborted because the execution process exited unexpectedly. Check the execution process logs for more information. If the logs are not enabled, then enable the logs and try again.
========== Run test finished: 0 run (0:00:16.9130904) ==========

OS: Windows 7 Enterprise
IDE: Visual Studio 2015 update 1

Everything worked fine prior to update 1.

@MrHypa
Copy link

MrHypa commented Dec 21, 2015

Thank you for contacting Jace Web Technologies.  Our office will be closed from 12/22 to 12/29.  We hope you enjoy the holidays with your loved ones!  Stay safe this holiday season and we look forward to servicing you next week into the new year! 

Jace Web Technologies

@BastiaanMaan
Copy link

Hi,
We have the same issue and reduced it to Specrun. After switching to MStest we were able to run our specflow tests again, but now, of course, we miss the reports and the rest of the specrun benefits.

@fatmanmclone90
Copy link

Same issue for me, to workaround had to switch to MSTest for execution.

@PatrickKarcher
Copy link

And same here. Recently installed Update 1 then installed SpecRun, immediately had problem. Switching unitTestProvider back to "MsTest" makes my tests work again, which is good, but what I'm currently trying to accomplish is to evaluate SpecRun. So I'd like it to work so I can evaluate and then buy 4 licenses (hint hint!)

@Stephen-Mc
Copy link
Contributor

We're taking a look at this issue. Rob (the OP) states that he has this problem with new projects as well as existing projects, and that tests work in VS 2013. It would be great to get more feedback from all of you so we can try and narrow down the cause. Judging by the posts in this thread, a common theme seems to be Update 1 for VS 2015. However, samholder reports having had no issues with VS 2015 Update 1. Any insights into why this might be the case would obviously be appreciated :)

Could those of you who are experiencing this problem tell us:

  • Are you having this problem exclusively with Update 1 for VS 2015? What version of Visual Studio have you tried executing your tests in, and which versions work?
  • Are the projects you are experiencing this issue with older projects, migrated from an earlier version of Visual Studio? Does the problem still persist if you create a new project in VS 2015 from scratch?
  • What version of SpecFlow and SpecRun are you using?
  • What OS are you using?

Thank you in advance for your help.

@samholder
Copy link
Contributor

Just to be clear I was not using SpecRun, it wasn't clear that that was
what the OP was using from the original post

On Thu, Jan 7, 2016 at 2:09 PM, Stephen McCafferty <notifications@github.com

wrote:

We're taking a look at this issue. Rob (the OP) states that he has this
problem with new projects as well as existing projects, and that tests work
in VS 2013. It would be great to get more feedback from all of you so we
can try and narrow down the cause. Judging by the posts in this thread, a
common theme seems to be Update 1 for VS 2015. However, samholder reports
having had no issues with VS 2015 Update 1. Any insights into why this
might be the case would obviously be appreciated :)

Could those of you who are experiencing this problem tell us:

  • Are you having this problem exclusively with Update 1 for VS 2015?
    What version of Visual Studio have you tried executing your tests in, and
    which versions work?
  • Are the projects you are experiencing this issue with older
    projects, migrated from an earlier version of SpecFlow? Does the problem
    still persist if you create a new project in VS 2015 from scratch?
  • What version of SpecFlow and SpecRun are you using?
  • What OS are you using?

Thank you in advance for your help.


Reply to this email directly or view it on GitHub
#534 (comment).

@PatrickKarcher
Copy link

Hi Stephen.

I've been using SpecFlow for several months successfully, in Visual Studio
2015 and Windows 7.

(Really like it by the way. Gonna make a big wad of CUI tests. Planning
on using advantages of SpecRun for parallelism.)

I installed SpecRun in December for a day, tests ran successfully, I then
de-installed because I wanted to take care of some other things before I
committed my team to SpecRun.

I install Update 1 for VS2015 a week ago.

I then installed SpecRun again yesterday (not without some adventure
http://stackoverflow.com/a/34643499/97890), and began have the problem in
question.

Thank you!

-Patrick

On Thu, Jan 7, 2016 at 9:09 AM, Stephen McCafferty <notifications@github.com

wrote:

We're taking a look at this issue. Rob (the OP) states that he has this
problem with new projects as well as existing projects, and that tests work
in VS 2013. It would be great to get more feedback from all of you so we
can try and narrow down the cause. Judging by the posts in this thread, a
common theme seems to be Update 1 for VS 2015. However, samholder reports
having had no issues with VS 2015 Update 1. Any insights into why this
might be the case would obviously be appreciated :)

Could those of you who are experiencing this problem tell us:

  • Are you having this problem exclusively with Update 1 for VS 2015?
    What version of Visual Studio have you tried executing your tests in, and
    which versions work?
  • Are the projects you are experiencing this issue with older
    projects, migrated from an earlier version of SpecFlow? Does the problem
    still persist if you create a new project in VS 2015 from scratch?
  • What version of SpecFlow and SpecRun are you using?
  • What OS are you using?

Thank you in advance for your help.


Reply to this email directly or view it on GitHub
#534 (comment).

@jiristeidl
Copy link

Using VS2015 Update 1, Windows 8.1
SpecFlow 1.9, SpecRun 1.2

I've tried new project with just SpecFlow and SpecRun and just single step and it still doesn't work, switching to MsTests fixes that,

this is the exception from event log

Application: te.processhost.managed.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Runtime.InteropServices.COMException
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32, IntPtr)
   at WEX.TestExecution.FrameworkHandle.RecordStart(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestCase)
   at TechTalk.SpecRun.VisualStudio.TestAdapter.VsTestTracer.OnEvaluationWaitStarted(Int32)
   at TechTalk.SpecRun.VisualStudio.TestAdapter.VsExecutionEngine.OnEvaluationWaitStarted(Int32)
   at TechTalk.SpecRun.Framework.ExecutionEngine.ValidateTool(TechTalk.SpecRun.Framework.Configuration.TestRunExecutionConfiguration)
   at TechTalk.SpecRun.Framework.ExecutionEngine.ExecuteTestSuite(TechTalk.SpecRun.Framework.Configuration.TestProfile, TechTalk.SpecRun.Framework.Configuration.TestRunExecutionConfiguration)
   at TechTalk.SpecRun.VisualStudio.TestAdapter.SpecRunTestExecutor+<>c__DisplayClass9.<ExecuteTestSuite>b__7()
   at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ThreadHelper.ThreadStart()

@fatmanmclone90
Copy link

Error for me occurs on:
VS 2015 Update 1
Windows 10
Specflow 1.9
SpecRun 1.2 (I think)

Mine's a new project so never had the tests running before. Still using MSTest until issue resolved.

@SabotageAndi
Copy link
Contributor

@jiristeidl thanks for the StackTrace.
@PatrickKarcher & @fatmanmclone90: Could you look if you have the same stacktrace in your event log? Thanks!

@PatrickKarcher
Copy link

Yes, seems exactly the same:

Application: te.processhost.managed.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Runtime.InteropServices.COMException
at
System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32,
IntPtr)
at
WEX.TestExecution.FrameworkHandle.RecordStart(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestCase)
at
TechTalk.SpecRun.VisualStudio.TestAdapter.VsTestTracer.OnEvaluationWaitStarted(Int32)
at
TechTalk.SpecRun.VisualStudio.TestAdapter.VsExecutionEngine.OnEvaluationWaitStarted(Int32)
at
TechTalk.SpecRun.Framework.ExecutionEngine.ValidateTool(TechTalk.SpecRun.Framework.Configuration.TestRunExecutionConfiguration)
at
TechTalk.SpecRun.Framework.ExecutionEngine.ExecuteTestSuite(TechTalk.SpecRun.Framework.Configuration.TestProfile,
TechTalk.SpecRun.Framework.Configuration.TestRunExecutionConfiguration)
at
TechTalk.SpecRun.VisualStudio.TestAdapter.SpecRunTestExecutor+<>c__DisplayClass9.b__7()
at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
at
System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext,
System.Threading.ContextCallback, System.Object, Boolean)
at
System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,
System.Threading.ContextCallback, System.Object, Boolean)
at
System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,
System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()

-Patrick

On Fri, Jan 8, 2016 at 7:03 AM, Andreas Willich notifications@github.com
wrote:

@jiristeidl https://github.com/jiristeidl thanks for the StackTrace.
@PatrickKarcher https://github.com/PatrickKarcher & @fatmanmclone90
https://github.com/fatmanmclone90: Could you look if you have the same
stacktrace in your event log? Thanks!


Reply to this email directly or view it on GitHub
#534 (comment).

@rushalias
Copy link

Bit more Information:

Packages installed.
SpecFlow (Version = 1.9.0)
SpecFlow.NUnit (Version = 1.1.1)
SpecRun.SpecFlow (Version = 1.2.0)
SpecRun.Runner (Version = 1.2.0)
NUnit (Version = 2.6.0.12054)

OS: Windows 7 Enterprise
IDE: Visual Studio 2015 update 1

When I select to Run All form Test Explorer window all seems to run just fine.

 ------ Run test started ------
SpecRun Evaluation Mode: Please purchase at http://specrun.com to remove test execution delay.
SpecRun: running tests in C:\Users\ltahmazyan\Documents\Visual Studio 2015\Projects\HelloUnitTestProject\HelloUnitTestProject\bin\Debug\HelloUnitTestProject.dll
Profile: 
Evaluation mode: test execution starts in 13 seconds...
(this delay is removed in the registered version)
TestMethod: AddTwoNumbers("0","50","70","120",null) in AddTwoNumbers -> Succeeded on thread #0
TestMethod: AddTwoNumbers("1","5","7","12",null) in AddTwoNumbers -> Succeeded on thread #0
TestMethod: AddTwoNumbers("2","1","1","2",null) in AddTwoNumbers -> Succeeded on thread #0
TestMethod: AddTwoNumbers("3","10","10","20",null) in AddTwoNumbers -> Succeeded on thread #0
Result: all tests passed
  Total: 4
  Succeeded: 4
  Ignored: 0
  Pending: 0
  Skipped: 0
  Failed: 0

  Execution Time: 00:00:00.9530000
Report file: file:///C:\Users\ltahmazyan\Documents\Visual%20Studio%202015\Projects\HelloUnitTestProject\TestResults\Unnamed%20project__2016-01-08T095442.html
Log file: file:///C:\Users\ltahmazyan\Documents\Visual%20Studio%202015\Projects\HelloUnitTestProject\TestResults\Unnamed%20project__2016-01-08T095442.log
========== Run test finished: 5 run (0:00:17.786) ==========

However when I try Run Selected Tests by right clicking on a test I want to run in Test Explorer window, it fails with following message as reported by others.

------ Run test started ------
SpecRun Evaluation Mode: Please purchase at http://specrun.com to remove test execution delay.
SpecRun: running tests in C:\Users\ltahmazyan\Documents\Visual Studio 2015\Projects\HelloUnitTestProject\HelloUnitTestProject\bin\Debug\HelloUnitTestProject.dll
Profile: 
The active Test Run was aborted because the execution process exited unexpectedly. Check the execution process logs for more information. If the logs are not enabled, then enable the logs and try again.
========== Run test finished: 0 run (0:00:13.9772179) ==========

Hope this helps.

@SabotageAndi
Copy link
Contributor

Thanks for the info. So there is only one bug. We could reproduce the bug and are working on a fix.

@samholder
Copy link
Contributor

Is this an issue in specflow or in specrun? We have recently seen an issue
with navigating to step definitions from the feature files which is
similar, I.e. a com exception, so we are curious if the issue you have seen
I'd with specflow or specrun as we do not use specrun.
On 8 Jan 2016 6:44 p.m., "Andreas Willich" notifications@github.com wrote:

Thanks for the info. So there is only one bug. We could reproduce the bug
and are working on a fix.


Reply to this email directly or view it on GitHub
#534 (comment).

@SabotageAndi
Copy link
Contributor

This is an issue in the Visual Studio Integration of SpecRun.

@samholder
Copy link
Contributor

OK thanks. I'll try and get repro details and file another bug
On 8 Jan 2016 7:03 p.m., "Andreas Willich" notifications@github.com wrote:

This is an issue in the Visual Studio Integration of SpecRun.


Reply to this email directly or view it on GitHub
#534 (comment).

@SabotageAndi
Copy link
Contributor

We have fixed the bug.
The next version of SpecRun will contain the fix. The release should be in the next days.

@PatrickKarcher
Copy link

Fantastic, thank you.

-Patrick

On Tue, Jan 12, 2016 at 6:24 AM, Andreas Willich notifications@github.com
wrote:

We have fixed the bug.
The next version of SpecRun will contain the fix. The release should be in
the next days.


Reply to this email directly or view it on GitHub
#534 (comment).

@SabotageAndi
Copy link
Contributor

We have release SpecFlow+Runner 1.3 beta11. This fixes this issues.

https://www.nuget.org/packages/SpecRun.Runner/1.3.0-beta11

@gamler
Copy link

gamler commented Jan 21, 2016

Thanks for the update. However I've got another error like this:

Unable to load plugin: SpecRun. Please check http://go.specflow.org/doc-plugins for details. -> Could not load file or assembly 'SpecRun.SpecFlowPlugin' or one of its dependencies. The system cannot find the file specified

Not sure if this could be caused by some misconfiguration, so here is a part of my packages.config:

<package id="NUnit" version="3.0.0" targetFramework="net45" />
<package id="SpecFlow" version="2.0.0-preview20151221-10" targetFramework="net45" />
<package id="SpecFlow.NUnit" version="2.0.0-preview20151221-10" targetFramework="net45" />
<package id="SpecRun.Runner" version="1.3.0-beta11" targetFramework="net45" />
<package id="SpecRun.SpecFlow" version="1.3.0-beta11" targetFramework="net45" />

and app.config:

<specFlow> 
    <unitTestProvider name="SpecRun" /> <!-- optionally SpecRun+NUnit 
or SpecRun+MsTest here --> 
    <plugins> 
      <add name="SpecRun" /> 
    </plugins> 
  </specFlow>

All the packages were installed via Nuget Package Manager Console.
Does anybody know a way to solve it?

@SabotageAndi
Copy link
Contributor

Is your test project 4.5? It could be a small packaging bug we found yesterday. We put the SpecRun.SpecFlow.dll for 4.5.2 into the net45 folder of the NuGet package.

You should see a warning about a library with a higher Framework Version.

Can you change your test project to 4.5.2?

@gamler
Copy link

gamler commented Jan 21, 2016

It helped. Thank you so much for the quick response.

@carlin-q-scott
Copy link

Why is this closed? Did you guys fix the packaging issue?

@rushalias
Copy link

I'll second @carlin-q-scott
I happen to be working on a project that uses .Net 4.0, for which the suggested fix does not work.

@SabotageAndi
Copy link
Contributor

@carlin-q-scott: The packaging issue is solved with beta20 of SpecRun. https://www.nuget.org/packages/SpecRun.Runner/1.3.0-beta20
Sorry, forget to post something here.

I asked @gasparnagy to close it, because the issue was about Debugging in VS 2015.

@rushalias: .Net 4.0 is not supported by SpecFlow 2.0. If you have to stick with .Net 4.0 you have to use SpecFlow 1.9. For that there is a seperate package to use: https://www.nuget.org/packages/SpecRun.SpecFlow.1-9-0/1.3.0-beta20

@PatrickKarcher
Copy link

By the way, the fix has also worked for me. I've installed the new install
and I'm off to the races. I have a heck of a time getting the Nuget
package to fully install (including create the 3 solution files), but I
finally did (again) and all is good. Running all these tests in parallel
warms the heart.

-Patrick

On Mon, Jan 25, 2016 at 3:19 PM, Andreas Willich notifications@github.com
wrote:

@carlin-q-scott https://github.com/carlin-q-scott: The packaging issue
is solved with beta20 of SpecRun.
https://www.nuget.org/packages/SpecRun.Runner/1.3.0-beta20
Sorry, forget to post something here.

I asked @gasparnagy https://github.com/gasparnagy to close it, because
the issue was about Debugging in VS 2015.

@rushalias https://github.com/rushalias: .Net 4.0 is not supported by
SpecFlow 2.0. If you have to stick with .Net 4.0 you have to use SpecFlow
1.9. For that there is a seperate package to use:
https://www.nuget.org/packages/SpecRun.SpecFlow.1-9-0/1.3.0-beta20


Reply to this email directly or view it on GitHub
#534 (comment).

@rushalias
Copy link

@SabotageAndi Thanks for the followup. using suggested package of https://www.nuget.org/packages/SpecRun.SpecFlow.1-9-0/1.3.0-beta20 works just fine with .Net 4.0. Thanks again.

@lock
Copy link

lock bot commented Jul 9, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 9, 2019
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