Breakpoint cannot be deleted in a C # project for anything other than .NET 3.5

I just updated the solution previously run in VS2008 on .NET 3.5 , on VS2015 running on .NET 4.6 .

Some project information

  • The solution has only one project and Unit Test Project and simply creates "AVTest.dll", which we load into NUnit to run some functional tests on some hardware.
  • We do not start it directly, we open NUnit.exe through the initial event of debugging an external program. we load the .dll created by C # build, and NUnit can run a series of tests. By running NUnit this way, in the past we could debug routines in unit test.
  • The version of NUnit is 2.5.10, which uses .NET 2.0 (given that we worked and broke with .NET 3.5, it looks like this is probably not the case). I also updated o The latest stable version of NUnit (2.6.4.NET 3.5) and no changes.
  • We do not have a launch project - everything goes through NUnit.

Everything builds and works correctly, but when you try to set breakpoints, the following error occurs:

At the moment, the breakpoint will not be deleted. No characters have been loaded for this document.

When I get back to .NET 3.5, I can set breakpoints in the code. The fact that I can do this makes me think that I missed something simple about the .NET version, since I am not familiar with c# .

I know this question and tried all the things from the question itself and the first page of answers.

Have there been any changes in how to check why there were no characters loaded?

New development

I can debug fine when I connect to a Nunit test that is already running. I am not sure why it is not connected after starting (via launching an external program) or why it works in 3.5 and not in 4.6, but it can be debugged ...

+5
source share
1 answer

This turned out to be a simple problem with NUnit, not with Visual Studio. Essentially, you need to add this to your NUnit configuration file before the <runtime\> section:

  <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0"/> </startup> 

This file is usually located here:

C: \ Program Files (x86) \ NUnit 2.5.10 \ bin \ net-2.0 \ nunit-x86.exe.config

Credit for this answer comes from here .

0
source

Source: https://habr.com/ru/post/1233300/


All Articles