VB.NET - Application has encountered a user-defined breakpoint - vb.net

I'm not that up on VB.NET, the application I'm working on was not written by myself.
It works fine through the IDE but once I run it from the exe it gives me the above error.
Any clues?
This is really hacking me off!

The only user defined break point that I can think of is
Debugger.Break()
So, I would suspect that the .exe is compiled in debug mode. I would recommend Reflector to look at the code and find out for sure whether or not there is a Debugger.Break() somewhere in there.

Afaik, the only way this could occur if you are compiling under debugging settings. You should be able to fix it by doing the following:
Right-click your solution on the
solution explorer.
Select configuration properties.
At the top of the dialog box there should be a
combobox, which will most likely say
"Active(Debug)".
Click on the dropdown and select release.
Ok out of everything.
Build > Rebuild Solution.
Source: p2p.wrox.com

I believe the exe file was compiled using the "Debug" setting. Try changing the Build setting to Release and do a full build (rebuild) of the project. Then try to run the executable file. It should then run normally.
The reason you see that error is because when you normally compile and run applications in Visual Studio, it compiles a Debug build of the executable. The different between a debug build and a release build is that the debug build has additional information added to it, by the compiler, so it can be debugged properly.

I would suggest looking for stop in your code. That is what generated this error for me.

Related

Debugging a .net core container from docker-compose in Rider is buggy

I have a solution which was written originally in VS and I'm trying to run and debug it using Rider. I'm using the original docker-compose. It mostly works smoothly, but for one thing, which is debugging.
Basically the debugging will start and run fine too, the breakpoints are being hit but some variables, when trying to see their value (no matter if by hovering, using immediate window or whatever) will instead show en error:
the name 'x' does not exist in the current context
Any ideas on what could possibly be the reason of such behaviour?
In case anyone stumbles upon this. The solution was to change the dotnet build command's configuration flag to Debug from Release in the Dockerfile.
I don't know how come it works in Visual without changing this flag, maybe there is some automatic override when setting solution run mode to debug or something. However, it seems in Rider it doesn't work automagically :)

IntelliJ remote debug gradle project can't attach sources

I'm having trouble getting IntelliJ to recognize which source files correspond to the thing I'm trying to attach a debugger to. The project in question is a Gradle project running locally, using Java 1.7. (EDIT: I'm actually also running that project from within IntelliJ, and that's also what's building it. It's a Gretty task defined in the project's build.gradle file. I'm passing
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5006
to the JVM to open the debugging port.)
I can tell that the debugger is attaching to the process correctly since I get the "Connected to the target VM" message. But breakpoints do not get the checkmark, and they aren't hit during execution. (EDIT: This is leading me to believe that the sources aren't being attached -- The debugger is attaching to a process successfully, and I have reason to believe that process is the one I want since I'm using JVM arguments on it to open the debugging port, but it appears to me that the IDE doesn't recognize what source files correspond to the running code.)
The other person who works on this code does not seem to have this issue. He's on an older version of IntelliJ. His "use module classpath" dropdown has a <whole project> option and mine does not (though it does have <no module> -- is that the same?). Unsure which version of IJ he's on specifically; I'm on Ultimate 2018.3.
I'm sure that I need to include more information than this, but due to my unfamiliarity with Gradle as a build/run tool and with how remote debugging works in general, I don't know what information I'm missing -- of course I will provide it as soon as someone asks me for it.
BIG EDIT (and probably the real answer here): I have a feeling I'm attaching to Gradle itself rather than the task. If I choose Run -> Attach to Process, the dialog shows me "45039 org.gradle.launcher.daemon.bootstrap.GradleDaemon (5006)".

MSBuild always build all platforms even when specific one provided

Any ideas as to why MSBuild is always building all my platforms for my UWP solution even though I'm specifying to only build for the ARM platform. This is the command line I'm using:
MSBuild.exe C:\MyApp\MyApp.sln /p:Configuration=Release /p:Platform=ARM
Am I missing something or doing something wrong?
Thanks.
UPDATE - 1:
I've also tried specifying x86 as the platform, but it still builds all platforms.
After spending hours trying to figure out this problem, I have eventually figured out what's wrong, well partially at least!
As mentioned, the above does not work as expected, unless I first create a package via the .NET IDE and only select a single platform. Once I do this, the above command line will build the relevant platform that's specified in the command line!
I've just tried it again and created a package via the .NET IDE and re-selected all platforms and called my original command line once again, and it build all platforms rather than the one specified in the command line. There is obviously something in the solution file that's causing this but personally I think this behaviour is wrong and is a bug.
The following command lines seem to worked irrelevant of what has been selected via the .NET IDE:
To only build a package for ARM in Release mode:
msbuild "c:\myapp\myapp.sln" /p:configuration=release;platform=ARM;
AppxBundle=Always;AppxBundlePlatforms="ARM"
To only build a package for x86 in Debug mode:
msbuild "c:\myapp\myapp.sln" /p:configuration=debug;platform=x86;
AppxBundle=Always;AppxBundlePlatforms="x86"
While the above works, irrelevant of what's selected in the .NET IDE, I haven't figured out how to build all platforms.
I'll also investigate the original command line problem and the link with via the .NET IDE selection, and I'll update my answer if I find out what's causing it.
Hope this helps.

Xcode builds on Debug but not on Release

So, I have this problem when trying to build my project.
Currently If I run the project in Debug mode, it runs fine, the app starts up on the device and I can test stuff.
However the weird part is when i switch over to the Release build and try to build on the device. When I press the Run button Xcode builds as normal and the build succeeded notification even pops up, but then I get this error code.
Lets call my app xxx
Could not launch "xxx.app"
No such file or directory:
/Users/*my Name*/Library/Developer/Xcode/DerivedData/*Bunch of xcode folders*/Products/Release-iphoneos/xxx.app/xxx
I went into finder and searched up xxx.app and couldn't find it. Furthermore there doesn't even exist a Library folder under /Users/my Name/.
So what is xcode trying to do here, and what should I do to fix this?
Edit: I have also tried Cleaning the project and building again, the error code still comes up.
I get this crap all the time.
What I do is clean the project, close it, shut down Xcode, start up Xcode, open project, then build and run.
If that still does not work then find the "DerivedData' folder Organizer->Projects and delete it, then do the above again and try again.
I tried creating a new scheme and setting it to Release mode. That worked for me. However, a reboot after closing xCode seems to work, too.
I went into finder and searched up xxx.app and couldn't find it. Furthermore there doesn't even exist a Library folder under /Users/my Name/.
It does exist, but it's hidden (since OSX Lion) in the Finder (because standard users -- as opposed to developers -- should not mess with it).
Some utilities (on a simple command line) can make it visible again but the simplest thing to do is to use "Go" menu of the Finder and select "Go to folder…" (Command-Shift-G). Then copy/paste the path you want to go to and validate.

Very long build time in Visual Studio

I've a solution with 15 projects (14 class libraries and one web application). Each class library has corresponding test project (i.e. if I have MyApp.Services project there exists MyApp.Services.Tests -- using NUnit). Everything is written in VB.NET. The problem is that when VS tries to compile any of *.Tests project it stops responding (the bigger the project the longer the period without reposnse). I don't know where to start looking for an issue. I'll add that I've R# 4.5 installed.
UPDATE 1:
Is there any way to benchmark a build in visual studio? To get build times for every project?
UPDATE 2:
It seems that there is no difference after disabling R#.
Try turning on verbose logging for the build
Tools...Options...Projects and Solutions...Build and Run..."MSBuild project build output verbosity"
This should help you get a better picture of what is going on.
Disabling Resharper will probably help.
As for the benchmark, try building with msbuild with the following options, it will print statistics on build process at the end.
msbuild yoursolution.sln /verbosity:diagnostic
Try closing the tool panes associated with unit testing.
Have you tried disabling Resharper 4.5, using the Tools->Addins menu, and tried building again?
Also, is there a difference in time if you shutdown VS, restart it and load your solution and try building again before you do anything else. It might be that the build times get slower over time?