break point not hit in ASP.NET web API remote debug in IIS - remote-debugging

I have attached my Visual Studio 2109 debugger to the process with my web API published in IIS
But when I try to insert a break point
"the breakpoint will not be activated currently. No symbols have been loaded for this document"
Any idea please?
Regards

Another possible solution for the same type of error is that the build has "Optimize code" checked.
"Api project" > properties > Build > (select "Configuration" for the one you are debugging), make sure "optimize code" is unchecked.
If you changed it you need to deploy the project again.

The problem was that my webAPI is an ASP.NET Core 2 web API and in this case w3wp.exe is not the correct process. The process is the application itself. In may case api.exe instead w3wp.exe
thanks

Related

How to debug a Spring Boot application in Spring Tool Suite

I'd like to debug a simple Spring Boot application in Spring Tool Suite. It is a simple restful web service. I wanted to debug the controller and service class with embedded tomcat server.
Found this post how to debug Spring MVC application on Spring Source Tool Suite. I followed the steps:
Select Window-->Show View--> Servers.
Right Click on server in the Servers panel, select "Debug".
Add breakpoints in your code
Then right click on application, Select Debug As --> Debug on Server
After the first 2 steps, the output in console shows server has started up. However, I could find option of Debug on Server when I right clicked controller class. Application class is the only class that I could debug. However there is no way to "step into" Controller from Application.
Also, when should I launch browser and put in the request url?
First of all let's see how to launch you Spring Boot app in debug mode.
As you are using Spring Boot, you don't need an app server to run or debug it, as it is able to run in standalone mode by launching the Application class.
You have at least two ways to launch it in debug mode:
Right click on your Application class and select Debug as -> Spring Boot App. Debug as -> Java application will also work.
Open the Boot Dashboard view, right click on you application and select (Re)debug).
You can have more information about the Boot dashboard in this blog post: https://spring.io/blog/2015/10/08/the-spring-boot-dashboard-in-sts-part-1-local-boot-apps
Once the application is running in debug mode or before, it really doesn't matter, open the class (in your case the Controller) you want to debug and go to the line you are interested in. To add a breakpoint at that line, right click in the grey bar at the left end of the editor in that line and select **Toggle Breakpoint*, or just use Shift+Ctrl+B.
Then you can launch the browser and use the application. When the execution gets to the line where you have added the breakpoint, it will stop there.

Google Test(gtest) iOS signing error

Following this tutorial:Introduction to Google Test with Xcode 6 and C++11 i have integrated Google Test(or gtest) framework into my iOS project written in C++. But when i choose test target and press "Run" button i got this log:"Message from debugger: Terminated due to code signing error". This log appears after "Build Succeeded" popup. If anyone has thoughts of how to fix this siging error please let me know. (P.S. i have valid iOS certificate and provision profile and can upload builds to the TestFlight)
I have got rid of this issue by performing next actions:
Select Tests target as active target.
Go to Product->Scheme->Edit Scheme.
From the left menu choose Run.
Then in the right menu choose Info tab.
Change Build Configuration from Debug to Release.
After this i can run tests without "signing error":))

Debug web service running on local machine?

I'm using PowerBuilder Classic 12.1 to deploy a .NET Web Services target to IIS 7 running on my local machine. I'd like to be able to debug it. The documentation from Sybase says I should be able to. But when I run the debugger it says "Attaching to ASP.NET worker" and "Time left: 20 seconds". It counts down to 0 and then I see "Failed attaching to ASP.NET worker process."
I'm running PowerBuilder as an administrator, so I don't think that's the problem.
Suggestions?
Open your your project object that you are using to deploy with. If you have multiple project objects, then right click on your target in the tree-view painter and click preferences to open a dialog that let's you choose which target object will be used for deployment. Choose the one that is set with DEBUG symbol on and set to debug build.
I have had good luck debugging PB Web Services both IIS hosted and self-hosted.
I also found this in the PowerBuilder help file for you:
Using the DEBUG symbol
If you used the DEBUG conditional compilation symbol in code for the nonvisual objects you deploy as a Web service and you want this code to run, you must make sure that the enable DEBUG symbol check box is selected before you deploy the project. If you plan to debug the assembly or Web service, you should make sure the project is deployed as a debug build.
** added additional details here on 1-26-13
This blog article will help you get WCF debugging to work in PowerBuilder.NET.
Testing & Debugging PowerBuilder.NET WCF Web Services

ASP.NET Web Service returning Bad Request in Windows Azure

After a Windows 7 fresh restart, I open the Visual Studio 2010 as administrator, create a new project of Windows Azure Project with ASP.NET Web Role, then at the WebRole1 project I add a WebService1.asmx and press F5 (run).
The Windows Azure services starts OK and the browser open the http:/127.0.0.1:8080/WebService1.asmx perfectly. But when I click at Invoke button to test the webservice method I always receive a Bad Request - Invalid Hostname, with a http:/127.0.0.1:8081/WebService1.asmx/HelloWorld.
The most likely cause is ASMX's WSDL file doesn't stand by load balanced environment such as Windows Azure. The test feature relies on WSDL. You will see similar issues if you add a web/service reference. It is recommended to upgrade to WCF. In WCF, you can use useRequestHeadersForMetadataAddress (http://msdn.microsoft.com/en-us/library/ee816894.aspx) to fix the issue. If you need to use ASMX, please try to manually provide a correct WSDL file.

Debugging asmx web services

How can I debug asmx webservices running on IIS? I read that I must Attach to process called aspnet_wp or w3wp. But I can not find these processes... I selected checkbox show processes from all users but still nothing. What can be wrong?
regards
If your service is not running, then there might not be a worker process running. Start your service by accessing it from the browser, of use "View In Browser" from inside of Visual Studio.
It may not be what you are looking for, but can't you run your project from visual studio first? I usually do it that way before going to IIS.
Or does your project run fine on VS and an other way with IIS? I personnaly never done it myself since I debug all my code in local.
As far as remote and local IIS debugging are concerned, I think you can check on this site CodeProjectI and CodeProjectII. The author claims to be a former MVP in ASP.NET, should be useful.
You have to be logged onto the machine that runs web service. You would need a debugger installed on that machine.
If that is not possible, you can install remote debugger for VS on the server. To install remote debugger you just need to copy msvsmon.exe from your VS installation CD or from machine where VS is already installed and start it.
Then when you attach to proccess from your machine you can type in the name of your remote server and click Browse. You should be able to see all proccess that are running on remote server. You would need administrative or Debugger rights on that server.