-
Notifications
You must be signed in to change notification settings - Fork 106
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
Fatal error debugging tests via Test-Explorer #320
Comments
(FWIW I can debug individual tests with 3.8-alpha in my setup, so this problem is not universal. I don't know if it is relevant, but I am not using Moq, and I have VS Professional 2017 15.0.0+26228.9.) |
Debugging is one of the main tests before releasing, so it is definately not universal.
We need to identify what is different about your project or setup so that we can fix this 👍 |
Hi Rob, I'm little bit confused: The solution, which was generating the mentioned fatal error yesterday, is working today. I'm quite sure I didn't change anything (code, extensions, packages, etc.). My co-worker had the same issue yesterday. Today it is working too?! I'm also able to debug all your tests in the NUnitPlatformTests-Solution. Currently I'm not able to reproduce the error. |
@bunnu don't you love working with .NET Core? Thanks for letting me know. I am going to keep this issue open for a bit so others can confirm if it is an issue or not. Maybe it just required a restart of Visual Studio? I do @Gerfaut can you let us know if it is working for you yet? If not, can you answer any of my questions that I posted above? |
My first try yesterday was restarting Visual Studio, but it didn't solved the problem. Maybe the antivirus caused the issue? I'm using Kaspersky Endpoint Security 10. @Gerfaut which AV are you using? |
Hi @rprouse, I have the exact same behavior than @bunnu, my previous try is now working... but I succeed to recreate the problem.
My AV is BitDefender Endpoint Security Tools but I don't think there is a issue with this :) Does it help a bit ? Thanks! |
@Gerfaut thanks for the detailed report. My guess is that it is a Visual Studio or .NET Core tooling bug, but I am going to leave this open to confirm. Personally, Visual Studio 2017 is very buggy working with .NET Core. It often crashes or exhibits weird behaviour whenever I edit the CSPROJ files, so it could be related. For your other comments, the Service tag is added to all test project by Visual Studio. It is intended to speed up test discovery. The nunit_random_seed.tmp file allows for repeatable test runs when using NUnit's random features. It can be ignored. |
Hi @rprouse, Thanks a lot!! |
I had the same problem. Here is my project file: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp1.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="NUnit" Version="3.6.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0-alpha1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TestNUnit\TestNUnit.csproj" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project> It kept producing the same error message as above as many times as I ran it. Then I read some of the posts here that said "overnight it stopped happening". I decided to close Visual Studio 2017 and reopen it and then it started working. So, it looks like this probably isn't a problem with the test adapter, but a caching issue of some sort in Visual Studio. |
@NightOwl888 thanks for the update. It is definately looking like a Visual Studio issue, but I am going to leave this issue open for a bit so others can find it easily. |
I had the same problem with xUnit and solved this problem changing project type from Library to Console Application: <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netcoreapp1.1|AnyCPU'">
<OutputType>exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netcoreapp1.1;net461</TargetFrameworks>
<AssemblyName>MyProject.UnitTests</AssemblyName>
<ApplicationIcon />
<OutputTypeEx>exe</OutputTypeEx>
<StartupObject />
</PropertyGroup> My final csproj: https://gist.github.com/ircnelson/9cbddb681d520d7f581dbfc99709a9e1 |
I can confirm that changing from Library to Console App solves the problem. |
Following @Gerfaut 's recipe (Thanks, that was to the point!!!) , and updating to NUnit 3.7.1, and adapter 3.8.0-alpha1 I can confirm it still fails. I am pretty sure this is VS, so I'll contact them about it. It might be related to the adapter, that we're not acting the way we should (but don't know yet - A little bit of Kafka here), so I'll keep it open. PS: |
I had exactly the same problem. But after clean and rebuild the solution, the problem was solved. |
I had extactly the same issue. Not with NUnit, but XUnit. (So it is a Visual Studio issue, not NUnit issue!) It was all good last Friday (2017-10-27). This morning (2017-10-30), it crashes whenever I start a debug from test explorer. I could not fix it by restarting Visual Studio or restarting windows. I did the rebuild as suggested by Delpak, it worked. The error is gone. So try clean & rebuild. Good luck! |
@navin22 says this is probably related to microsoft/vstest#558 |
For me, removing the <Service Include="{GUID}"... solved the problem, at least temporarily. |
Had this issue with latest VS 15.6.1 |
I apologize if someone already mentioned this, but I encountered this error while trying to debug some Azure functions. You can run into this error if you specify a .NET framework version but have the function API specified to V2. |
I have the same issue :( MY SOLUTION I had a wrong
|
Cleaning Project resolved my issue. |
Close this for now, as there is nothing we can do. Feel free to add links to work-arounds. |
VS 2017 Pro. Version: 15.8.4 Still reproducing. Using NUnit 3.10.1.
|
@aleha84 That project uses an outdated project format. Create a new project and check if it works for you. You can clone and check this one: https://github.com/OsirisTerje/DotNetCoreTestExample |
@aleha84 Thank you! My issues was my test projects had a launchsettings! This is because before the fixes in 2.2 we were told for our tests, we need to target the |
I had this issue with VS 2017, Nunit3 |
Thanks for your work getting nunit3-vs-adapter running with .net core. Running tests via dotnet test or Test-Explorer in VS seems to work fine.
When i try to debug a test via Test-Explorer a Message-Box with following Message appears:
I'm using VS 2017 V15.1 (26403.79) and referencing following packages:
The text was updated successfully, but these errors were encountered: