Remote Debugging Azure Worker Role - azure

There are a million links like this one http://blogs.msdn.com/b/cie/archive/2014/01/24/windows-azure-remote-debugging.aspx, which more or less would seem to take care of the remote debugging setup. I have done this many times in VS 2013 Update 2, deployed, then attached to debugger and it simply does not work. Well, the debugger seems to attach, but I continually get the message when I hover over a break point informing me that 'The breakpoint will currently not be hit. No symbols have been loaded for this document' A while back I recall seeing a channel 9 presentation and they seemed to configre the symbol store. I tried configuring this and it still gives me the same message when hovering over the breakpoint.

VS 2013 Update 2 Remote Debugging - I can only get it to work with a 'Debug' build. I have set the Debugging Option "Enable Just My Code" and loaded all symbols -- this seems to work fine. I can now set breakpoints and do not receive the message you (and I) noted earlier.
This is probably not the ideal situation as it would be nice to be able to attach the debugger to a production release but it seems to be a semi-reasonable workaround for now.
EDIT:
Important points:
You must enable Remote Debugging in the Azure Portal for your Cloud Service or Web Site -- Configure Tab (it only remains enabled for 48 Hours)
The debug attribute of the compilation element in your Web.config file must be set to "true". This means, you either have to do a 'Debug' build or manually edit the Web.config file. Here is a link to official Microsoft documentation with a full explanation and a great example of how to do that without redeploying your application:
http://azure.microsoft.com/en-us/documentation/articles/web-sites-dotnet-troubleshoot-visual-studio/#remotedebug
If you still have problems you may have to disable the Debugging Option Enable Just My Code in Visual Studio

I had the same problem - also with VS 2013 Update 2.
The crucial bit I missed was selecting the w3wp.exe process in the pop-up that shows the running processes before hitting the Attach button.

Related

.net5 Azure Web App can not be debugged properly due to disconnects

I have a .NET5 Service running at azure. Now I try to debug and i can connect successfully after this issue. So one Problem solved, next:
But for now it seems to happen randomly, that after connection the debugger disconnects from service.
So I do following:
restart service at azure, did this many times. Also tested with stopping service and start manually again.
immediatly press shortcut for reattach to process because i want to watch ConfigureServices method.
it connects successfully
shows nothing, means not ending up in any breakpoint
May I be to slow? Do not think so and "Thread.Sleep || Task.Delay" are not helping for catching up any Breakpoint..
after beeing connected it takes almost no time and i get this in my Output:
Output
After few Seconds I get this
Within Azure Diagnostic Tools Application Event Logs I can see following list (I tried several times)
Two entries from list are relevant as i guess, first says RDB connected, second that application has shutdown
Local debugging works fine by the way! Any suggestions where to find additional logging information or what is going on here?
I just found some additional logging in the Cloud Explorer of VS2019. in eventlog.xml I can see many events saying debugger already connected
May be anybody can help me getting further. Otherwise I will setup a new Project in my solution, maybe i broke something, and create a new azure service to have those components clean. Thank you guys!
Update:
Now I created a new service at azure, Set up a new project in VS2019 and no improvement. I tried to check against a new project with View too and tried to see how far code is beeing executed by throwing exceptions and it seems to be executed with no problems through whole startup class, just the remote debugging seems not working because of remote debugger already connected.
This issue may be caused by having 'Use Managed Compatibility Mode' enabled.
To workaround:
List item
Tools->Options
Go to Debugging->General
Scroll down to the bottom of the list and uncheck 'Use Managed Compatibility Mode'
Start debugging again
The debug attribute of the compilation element in your Web.config file must be set to "true".
<system.web>
<compilation debug="true" targetFramework="*.*" />
<httpRuntime targetFramework="*.*" />
</system.web>
This means, you either have to do a 'Debug' build or manually edit the **Web.config** file.
Be sure to add your IP Address to the firewall rules while you are debugging remotely.

Performance issue while publishing package

Publishing package in my local system is taking much longer time than expected. It is taking around 15-20 minutes to publish, and sometimes it is throwing an error, UNABLE TO READ DATA like this.
I also tried even after Restart Application from Apply Updates screen but still same issue. How I can solve this?
You might want to try to disable web site building.
In Visual Studio, go to web site property pages and deactivate the following 2 configurations:
Uncheck Build Web site as part of the solution
Before run startup page - no build.
See http://asiablog.acumatica.com/2016/09/make-compilation-of-extension-library.html

Visual Studio 2015 / MVC 5: Attach to Process: Cannot obtain value of the local variable

I can connect to the w3p process on my IIS box just fine. I can step through, although it seems to skip some areas. Also, when I try to view a variable value, I get:
Cannot obtain value of the local variable or argument because it is not available at this instruction pointer, possibly because it has been optimized away.
I've seen MANY answer on this subject, but they all are geared toward local debugging. I am attaching to the server and getting this.
I have the source code and am working from that project. Does it matter if I publish the app to the server with the config set to 'Release'?
ANSWER: I switched it to 'debug' when publishing and now I can see the variables. I previously thought it was how it was set in the project properties, but it's how it's published to the server that makes the difference when publishing.

Remote Debugging Azure Mobile Service

Trying to debug azure mobile service running in the cloud. I have published debug configuration, in the options indicated to allow debugging non JustMyCode and use source server.
Attach to running process works and I could put break points and step through the code, though I could not get the values of any variables. Even 'this' would not show the values in the watch window.
Prior to that I was trying to debug a release published configuration and the watch used to display values of some of the variables. Others were indicated that due to optimizations values are not available.
Thanks for help,
Ruben
I think you did something wrong, because if you did the remote debug the break point should be hit and you can see all data.
Please see this article
Cconnecting a menu app to azure mobile service > How to do the remote debugging
If it not help, provide a movie with that you are doing :)
I recommend to have Azure SDK 2.5 and Visual Studio 2013 update 4

Azure-Deployment to stage ignores service configuration

I created a cloud service and tested it successfully locally. I added service configurations for stage and production. Here is a snippet of my staging-configuration:
and here my configuration-settings:
Then when I publish I set up the deployment as follows:
All this worked like 2 weeks ago. But now he deploys in VS and when I look into Azure Service Configure area it looks like this:
I played a little bit with the "Update development ..."-checkbox on the second screen but the result is the same.
So it ignores all the settings I made and just won't tranistion my configuration to the ine I named "CloudStage". My current Web PI tells me that I use Windows Azure SDK for .NET (VS 2013) 2.3. I don't get the point.
Edit
Some more things I observed:
No WADLogsTable and WADWindowsEventLogsTable is generated automatically in the staging storage.
I deactivated Remote Desktop because it was one of the changes I made to monitor the event log (which wasn't useful here)
I manually changed the connection strings in Azure Portal but it seems as if the worker is totally unaware of the storage (rebooted it with no success).
Edit
I recognized another thing. Here you can see a running deployment of my service:
See the warning-mark on the left? If I go to my Error list this is shown:
This warning is senseless since it tells me that I did everything the right way. My *.Local.csfg-files are pointing to the local storage. So?!?
This seems weird. Please check the in your ServiceConfiguration.CloudStage.cscfg to verify the expected values.
Have you tried updating any other property like Enabling Remote desktop? Does that get updated on your deployment? You should select the "Deployment Update" check box in the publish dialog. Now, when deploying to an existing Cloud Service, it should ask you if you want to replace it.
If you get the Object reference error every time you right click on project, there might be some issue with the Azure SDK set up.
I'm a little bit further now. What I did was:
Deleted all Services in Azure.
Deleted all Storage Accounts in Azure
Removed my Service-Project completely from solution (not the library containing the worker-logic).
Re-added storage-accounts in Azure.
Re-added services in Azure.
Re-added a project in the solution and added the worker-logic inside it.
Builded up all the publishing-stuff again.
Published it.
The first publish ended like the one described in my question. After I checked the "Update development..."-option in properties of my worker it finally took my transitions into the stage!
Now I recognized, that WADLogsTable was still empty. I hit the instance right in server-explorer and choosse "Update diagnostic settings...". There was an option "Transfer period" suddenly set to "None". This explained to me, why my table was empty and after I set it back to "1" my table is filling again!
Another funny thing beside: When I right-click my Cloud-project in the solution I get "Object reference not set to an instance...". When I just click it left and choose Build->Publish it works.
I just hope that I can help somebody with this. Lets see if it's stable now.
Edit: Yesterday it worked - today is still the same issue :-(.
When you get "Object reference not set to an instance.." for a CloudService project you usually have some kind of mismatch. It could be that a setting in the ServiceConfiguration is not defined in the ServiceDefinition. It could also be that there is a publish profile defined in the .ccproj file for the CloudService that doesn't exist. This might also be what is causing your problems with the different configurations.
So it turns out that the problem is completely on client-side. My Visual Studio (now with SDK 2.4) is doing something wrong. I set up a fresh installation with all the stuff needed :-( and there it works perfect. I'll try to determine if one of my extensions is causing the strange "Object reference not set..."-bug.
Repair-Installation of VS does not solve the problem btw.

Resources