Debug yii console app using netbeans - debugging

I can debug yii web app using netbeans but can't find the way to debug console app. I have enable debug according to instruction here => http://www.larryullman.com/2010/10/07/creating-a-yii-console-application/
But still cannot make my console app break at break point set in IDE. Any suggestion would be appreciated.
Thx

If you can debug web apps in netbeans its very easy to configure netbeans to debug console yii applications.
You must add a run configuration at project properties: Right click at project name, in projects tab and select the properties menu option.
Click in the "Run Configuration" categorie, at left column.
In the field "Configuration" ,Add a new configuration pressing "new..." button and give a name to the new configuration profile (i.e. console config).
In the Run As field,select "Script (run in command line)" option.
In the field "Index File" enter protected/yiic.php
In the "Arguments" field, enter the name of you yiic command and, if needed, other arguments.
Press OK button.
Now you have 2 run configuration profiles. To debug the console app, right click at project name in the Projects and switch to the new configuration profile in "Set configuration" option and use the IDE to debug as usual.
You can create a run configuration for each console command you have.
Regards.
Isidoro.

Related

How to change the default debug Profile when launching multiple asp .NET core projects?

I have a solution that launches multiple projects, and I set the launch profile for both to the console app instead of launching in IIS via the Project Properties page.
When I launched the projects individually they launched successfully in the console windows. But when I set multiple startup projects they went back to launching in IIS.
How can I get multiple projects to launch using the correct debug profile?
To set the default launch profile you can re-arrange the debug profiles listed in Properties > launchSettings.json. The first profile in the list will be the one used when launching multiple projects.
As mentioned in the comment of the other answer, it doesn't seems to be true for VS2022. It does not automatically use the first entry in the launchSettings.json list.
You can change the starting project to a single one and switch the debug profile with the small arrow next to the play button in the toolbar one by one. But if you need to do a mass switch, I suggest doing a "search in all files", it's stored in the .csproj.user files:
<ActiveDebugProfile>Docker</ActiveDebugProfile>
Change them all, then reload your solution.

VS2017- Solution Configuration won't apply changes - Does not build the selected configuration

I have a solution with one project and 3 solution configurations:
Debug
Release
Staging
When I for example choose "Release" in the quick menu toolbar to change the active solution configuration and Hit F5 I expect the solution to be compiled in Release mode, but whoooo it's still debug (Output window). Ok, let's go to the configuration settings and clear it up.
But the IDE will not apply my changes...? What's wrong here?
When I go to solution -> properties -> All Configurations I expected all my configurations to be visible that I have configured. As I have only one project, I expect "Release", "Debug" and "Staging (added by me)" to be present.
But they are all set to debug...
If you open the "Configuration Manager" via the Build entry.
It opens the same "Configuration Manager" when going the route: Right-click Solution --> Properties --> Configuration Manager.
Now you can choose the Active solution configuration for example "Release" and check if the projects configuration is also set to Release, if not change it.
Click Close and rebuild your solution. Now it should build the chosen configuration. You have to repeat these steps for every configuration: Debug|Test|Staging ...etc.
This time it will remember the settings!
When going solution- -> properties it will not, at least in my case.
(1) Make sure your solution file has a configuration set for the release mode you want.
To do this, right-click the solution in Visual Studio and choose Properties. Then use the "Configuration Manager..." button. In the dialog box that appears, for the project you want to add a configuration for, choose the drop down in the Configuration column.
(2) Right-click your project file in Visual Studio and choose Properties. Select the 'Build' tab. Make sure the 'Configuration' drop down menu has the build configuration you want to use and that you have a corresponding 'Conditional compilation symbols:' entry set that matches. See screen shot below.
(3) In your code behind file (.cs for C#). You'll should see the
#if VALIDATION
// Your code when building for VALIDATION
#elif PRODUCTION
// Your code when building for PRODUCTION
#endif
By changing the drop down at the top of the screen, each of the conditions you've coded for should be enabled/disabled (visually by shading of the text) based on the configuration selected.

Debug 2 projects in monodevelop

i have a simple question and maybe the solution is in front of my eyes but i cant see it:
How do i debug more than one project (eg.: server and client project) in monodevelop?
It now debugs just one project (breakpoints,..). after i close the first project monodevelop says: "Connot execute "path to .exe". A debugger session is already started."
So is it possible to have more than one debugger session?
thanks in advance
You can only run or debug a single application at a time (which is no different in Visual Studio, btw.), but you can run more than one instance of MonoDevelop.
If you only want to run the second application without debugging it, then you don't need to start another instance of MonoDevelop. You can either run the other project on the command line or simply define a custom command for it.
To add a custom command, right-click the project that you want to debug in MonoDevelop, select "Options", then goto "Run" / "Custom Commands", add a "Before Execute" command there. Click on the drop-down box on the right to see some variables that you can use for the command, such as ${SolutionDir}.

How to debug snapin, property pages in mmc?

I am new to snapin and property pages.
I have a source code that is developed in Visual basic 6.0 of snapin(userControl) and property pages that are referenced in snapin. These will be run in mmc. Now how can i debug this snapin and property pages by adding in mmc.
This post is very old but if it can help some one.
To debug a snapin, in the VB6 Editor, go to Project > Property of ...
Then, in the debugging tab, choose the third option "Start a programm" and type in mmc or the full path to mmc.exe (for me it was C:\Windows\System32\mmc.exe).
When you try to run you project, an MMC window will show up and you can go to File > Add Component ... and choose your snap-in project. Pay attention that 2 component coresponding to your project can be present. You have to try both with a breakpoint in your code to know witch one is debug one.
source
If some one know how to load automaticaly the project snap-in in mmc when running the project, it should be perfect !

VS2008: Launching the executable for a project that isn't the active project in a solution

In VS2008, Is it possible to launch the executable for a project that is not the active project in the solution? (i.e. its name is not in bold).
Not debugging it - just launching it. As far as I can see, you just have to drop in to Windows Explorer and double click the .exe! Am I missing a menu item or shortcut?
You can right-click a project to debug it. Right-click project -> Debug -> Start New Instance.
EDIT: I'm not sure of a way to do this outside of debug mode. That is essentially what the facility of the 'Active Project' is for. I typically set the active project and then use Shift+F5 to launch the application.
Right-click your solution and choose Properties.
Select Common Properties > Startup Project.
Select Multiple startup projects.
Next to the one you want to run, where it says None, change it to Start without debugging.
Does that do what you want?

Resources