When using an Exec task can I also control how the parsed warnings/errors are being presented in the Output/Error List panes? - msbuild

I have an Exec task with these attributes set:
CustomErrorRegularExpression="^Error in (?<FILENAME>[^:]+?):(?<LINE>[^:]+?):\s+(?<TEXT>.+)$"
CustomWarningRegularExpression="^Warning in (?<FILENAME>[^:]+?):(?<LINE>[^:]+?):\s+(?<TEXT>.+)$"
IgnoreStandardErrorWarningFormat="true"
Question: Is it possible to use the captures from the regular expression to shape how the Visual Studio IDE presents them to the developer in the Output and Error List panes?
Note: I found the idea with the captures here and it seemed intriguing, but it appears that Visual Studio still presents the location of the warnings/errors as being inside the .targets file which contains the Exec task.
Currently I am not able to get it to do better than:
1>Z:\foo\bar\baz\mycustom_stuff.targets(34,5): warning : Warning in foo\bar.xzy:123: some warning details here
Which in the Error List pane will present Z:\foo\bar\baz\mycustom_stuff.targets as location of the warning.

Related

Debug Design Mode in Visual Studio not breaking

So I am currently unable to open a Form and get the following error:
System.ComponenetModel.Design.ExceptionCollection was thrown.
or:
The designer loader did not provide a root component and has not indicated why
Usually the way to solve this is to open another instance of Visual Studio with the same project, attach the debugger to the other Visual Studio and try to open the form.
However, that does not seem to be working. The debugger does not break when the error is hit, and attempting to 'Break All' at any other point does not show me the source code and just the screen saying:
Your app has entered a break state, but there is no code because all threads were executing external code (typically system or framework code).
Attempting to put break points also results in:
The breakpoint will not currently be hit. No symbols have been loaded for this document
Am I missing a setting? Incorrect Setup?
I have been battling this for half a day and thoroughly search the interwebs with no luck thus far. My designer is also fairly complex and lengthy which means trial and error is an absolute last ditch option.
First attempt to resolve:
you may have tried it already. Right click the Solution in solution explorer, click "clean solution", this deletes all the compiled and temporary files associated with a solution.
Do a rebuild of the solution and try to debug again.
Second attept to resolve:
Start debugging, as soon as you've arrived at a breakpoint or used
Debug > Break All, use Debug > Windows > Modules. You'll see a list of all the assemblies that are loaded into the process. Locate the one you want to get debug info for. Right-click it and select Symbol Load Information. You'll get a dialog that lists all the directories where it looked for the .pdb file for the assembly. Verify that list against the actual .pdb location. Make sure it doesn't find an old one.
In normal projects, the assembly and its .pdb file should always have been copied by the IDE into the same folder as your .exe. The bin\Debug folder of your project. Make sure you remove one from the GAC if you've been playing with it.
third attept to resolve:
Disable the "Just My Code" option in the Debug/General settings.
there are might be other causes to your problem, i picked them from here. you may try other solution to try resolve your issues. Fixing "The breakpoint will not currently be hit. No symbols have been loaded for this document."

List of all errors in project in CLion

CLion 2016.2 helpfully detects potential errors in the file you're editing, which can be seen in the validation bar to the right of the code.
That's just a single file though, is there a way (like a tool window) to get a list of all such warnings in the whole project, or specific parts of it?
Bonus points if it also lists warnings and errors from the compiler, though that's less important, because the compiler output already includes any it found.
Yes, it is possible. The feature you are looking for is called the Inspector.
Do: Find Action... | Inspect Code. It will show a pop-up that will allow you to select the scope: file, whole project, custom, and the Inspection profile (you can choose the type of errors you want to see):
After clicking OK, this is an example of the output, that you can navigate with the mouse or with keyboard shortcuts:
In version 2017.2, I have it under Code | Inspect Code....
You can also right click a folder in Project view and select Inspect Code... there to be able to check only that folder.

Visual Studio cannot start debugging

I'm working through a project in Visual Studio 2013 and I got the following error: "Visual Studio cannot start debugging because the debug target is missing". I've tried changing the build output path under Project -> Properties but it still doesn't work. So what gives?
Check your code and make sure you aren't missing a curly bracket anywhere. If one was accidentally deleted, moved, or misplaced, it causes this error among MANY others depending how critical the placement of the curly bracket is in your project.
^
I just recently had this problem in a project I was working on. I had highlighted to delete a section of code, and it took out a curly bracket with it. Unnoticed by myself, it took me a few days to finally realize that's what happened.
You won't get an error from the bracket missing, so it's stupid in itself and impossible to find at times.. but I had 51 errors, 7 warnings, and that "can't start debugging because the debug target is missing" error when I attempted to run the program, after the curly bracket went missing.
It's not to say that you might not have another issue going on that is causing this, but the curly brackets can wreak havoc if they aren't precisely placed. So it's worth checking into that before getting too extreme in options to "fix" the start error.
For future reference if this problem occurs again. Good luck.
Possible VS 2019 Solution
Right Click on Solution Properties
Go under Common Properties> Startup Project
Set Single startup project
Right Click on Project Properties
Click Application
Set Application Type to Windows Forms Application or Console Application or Windows Service
Click Startup Object
Set to Anything Other than (None)
Left Click on Project Properties
Set Copy Build Output to Output to True
Then Run
Hopefully that works for you

JDeveloper Error Pane Not Showing

I am using the JDeveloper IDE to build a Java application and, at some point, my error pane has stopped appearing to display compile errors.
When I alter the code to intentionally produce errors during compilation (such as deleting a required parenthesis or brace, etc), I will be informed that there were errors during compilation within the "Messages - Log" window. However, I cannot find the window which describes the errors occuring and their location in the code.
Basically, I just want to access the window that lists the errors found, what class they are located in and what line or method they are in. How do I do this?
Try from menu Window > Reset Windows to Factory Settings.

How do I output code while debugging in Visual Basic 2010?

When I'm debugging my application something is not right, and I can't continue.
So is it possible to see the output code of my app while I'm testing it to see what is wrong?
I open the output window but nothing happens in there it's just stay blank.
In two words: I want to see what my app is actually doing while I'm testing it.
I'm using Visual Studio 2010.
So is it possible to see the output code of my app while im testing it to see what is wrong?
Yes, but you actually have to output something, otherwise nothing will show up. In VB.NET (which is the language you're using if you have Visual Studio 2010), this is accomplished with the following code:
Debug.Print("Here is some text that will be output.")
The documentation for the Debug.Print method is here. In order to call it like that, you will also have to have imported the System.Diagnostics namespace. You do so by placing the following line at the top of your code file (with all the other statements that look like it):
Imports System.Diagnostics
The output will automatically appear in the Output Window. If you still don't see anything, ensure that output is not being redirected to the Immediate Window instead: Tools -> Options -> Debugging -> General -> uncheck the option "Redirect all Output Window text to the Immediate Window".
Confusingly, you use the word "code" in your question, saying that you wish to "see the output code of [your] app while testing it". I'm not sure if by "code" you actually mean "output", in which case the solution above will work for you.
If you actually mean code, as in your program's source code, then you can use the Break toolbar button (or press Ctrl+Break) in the IDE to pause the execution of your program. This will automatically dump you back into the code editor with the currently-executing line of code highlighted.
Visual Studio has some very powerful debugging tools. If you don't already have a general idea of how to use them, I strongly recommend picking up a book on either it or VB 2010 that will teach these things to you. They can be very confusing to learn by trial and error, but are not all that difficult if you have a good guide. Spend that time debugging your code, not figuring out how to use the IDE.