Debugging Electron renderer process through Visual Studio - visual-studio

I have an Electron app that I'm debugging in VSCode. In my app, I create a BrowserView and load one of my websites: browserView.webContents.loadURL(myUrl);
Sometimes, I want to debug this website that's loaded in my BrowserView.
How I've been doing that is I open devtools in Electron and set breakpoints in the Chrome devtools that appears.
However, I wonder if I can spin up the localhost server from Visual Studio that hosts my website, and then debug my site directly from Visual Studio instead of through the devtools.
Is there a way to do this?
It seems like that won't work since the Visual Studio debugger is already attached and attaching it to the BrowserView's renderer process didn't work, but I wanted to check.

Is there a way to do this? It seems like that won't work since the
Visual Studio debugger is already attached and attaching it to the
BrowserView's renderer process didn't work, but I wanted to check.
I am afraid that you cannot get what you want.
Actually in Visual Studio, you cannot debug the renderer process. It does not support that. You have to use the Chrome devtools.
Besides, if you want this feature, you can suggest a feature on our User Voice Forum and hope the team will give you a satisfactory reply.

Related

Console of Dev Tools in Excel for Windows 7

I have built an add-in which works fine in Excel online, whereas it does not work in Excel 2016 for Windows.
I know that in Windows 10, we could use this tool to debug the add-in, however I am using Windows 7.
I just installed Visual Studio 2017, right clicking on the add-in shows a menu where Attach Debugger is. But clicking on Attach Debugger fires nothing.
Does anyone know how to debug in this case?
Two potential options:
You can use Volorn.js to remotely debug your add-in. You can use the Debug Office Add-ins on iPad and Mac article as a starting point. Although this article is targeting Mac and iPad, the concepts are the same for Windows.
You can also use Visual Studio by creating a new Excel Web Add-in. Simply replace the default manifest with your own. Note that you still need to retain the default web site, Visual Studio still this for some library references. It will use your manifest's URL for the source location however.
Office applications use Internet Explorer for the web browser, so all settings from IE should carry over. I have found that if you disable (uncheck) both the Disable script debugging (Internet Explorer) and Disable script debugging (Other) options, your debugger breakpoints will be hit (I tested this in Outlook 2016).
You will need add debugger; statements to the source code to add breakpoints. When these statements are hit, a dialog like this should appear:
Simply select 'Yes' and a new instance of visual studio should open, with the debugger attached to your script.

Enable extensions when debugging website in Chrome from Visual Studio 2017

Switching from Visual Studio 2015 to 2017 I find that launching a Web API project now starts a clean, separate Chrome window. For the most part I like that, and I certainly like the idea, however: this also means extensions are missing in Chrome.
Is there a way to start a Web API project from Visual Studio 2017 and have Chrome launch with extensions enabled?
Or, failing that, could I revert back to the old behavior where my project is opened as a fresh tab in my existing Chrome window?
I've tried Googling but found nothing. I checked the dropdown in Visual Studio with browsers (and checked the "Browse With..." dialog) but found no solution there either.
All you need to do is to sign-in to the instance of Chrome that VS2017 launches as the user you have all your usual extensions installed under (i.e. sign-in as the same user you usually sign-in as).
This sign-in "sticks", so extensions will load in the current - and all subsequent - debugging sessions.
You can revert back to the old behavior by
Debug > Options > Debugging > General > (uncheck) Enable JavaScript debugging for ASP.Net (Chrome and IE).
Is there a way to start a Web API project from Visual Studio 2017 and have Chrome launch with extensions enabled?
Yes, but it works for one project only, mean you need to re-install extensions when you launch a brand new project. I tried Sync in Chrome (not work).
In my opinion, there are something to do with Chrome remote debugging protocol profile. I hope someone knows about Chrome can give a final solution for this.
you can study more here: remote debugging protocol
There is a way that you no need to change anything. But it annoying.
Because Visual Studio 2017 use an instance of Chrome for debug mode when you hit F5, so you can leave that debug mode instance with remote debugging protocol open, and use your default Chrome instance with full extensions. Just copy and paste the link into your favorite Chrome instance.
Cheer! hope it help.

VS 2012: Real support for debugging via Chrome now is supported?

Can we now debug websites / services and set break points while using Google Chrome as the browser ? Or is this still only supportable in IE ?
I know before setting breakpoints (F9) and then debugging in IE worked without problems but using chrome was never supported.
I have tried to use google to find the answer to this but I am still unable to confirm it, I can't believe that debugging on services / sites are still not support in VS via another browser apart from IE.
I know the VS 2013 is upcoming, maybe this will address the problem?
EDIT
Sorry i should have made it clear, i am talking about client side debugging directly in VS using a NON IE Browser
You are misunderstanding client and server-side.
Client-side:
We don't care if the website is developed in .Net, with Visual Studio, PHP or whatever you want, the browser gives you some tools for debugging websites so the problem is from the browser not Visual Studio. Even if you upgrade to VS 2013 that won't change your problem, Visual Studio has no way to know the state of the JavaScript for a page opened by a client for example.
You may have heard about SignalR used in VS 2013 (Browser link feature) and that may have confused you, if so SignalR is only for refreshing client-side pages when you edit the view for example, but not for debugging.
Server-side:
Add your breakpoint in Visual Studio and then attach the debugger (Tools > Attach to process). In that way you will be able to debug server-side code (e.g. C# code) in Visual Studio. Note that the browser has no way to know the code server-side.

Visual Studio Debugging with Silverlight 4 and Firefox

When trying to debug a Silverlight 4 application in Visual Studio 2010 with Firefox as my browser, I am unable to hit any breakpoints. I get the message "breakpoint will not currently be hit".
Here is the solution that worked for me when debugging was not working in Firefox:
Type "about:config" into the address bar of Firefox
Find the property named "dom.ipc.plugins.enabled"
Change the value from true to false by double clicking
Restart all Firefox browsers
Go back to Visual Studio and start debugging!
Hope this saves someone else some time!
Firefox hosts silverlight (and other plugins) in a sandboxed process called plugin-helper.exe.
Manually attach your debugger to the correct instance of this (it'll have "Silverlight" in the process type field), and you get your debugging back, and you get to keep your plugin sandboxing too.
EDIT:
Looks like someone else sick of doing this by hand and wrote an VS2010 addon to automatically attach to plugin-helper.exe.

Windows 7 Gadget debugging with Visual Studio 2010

i try to debug a windows gadget. Just-In-Time debugging fires up and i can see an VS2010IDE attached to the sidebar process. But there is no source code to debug! Only a blank file with the yellow debug pointer. What is my problem?
Configuration of my system is based on this article:
Gadgets for Windows Sidebar Debugging (http://msdn.microsoft.com/en-us/library/bb456467(VS.85).aspx)
We have posted on the MSDN forum about this.
I think script debugging is broken in studio 2010 beta2.
I cannot get script debugging to work on my ASP.NET MVC project either.
We get a blank page, and the IDE cannot find the code to debug.
Trying to open files in the Internet Explorer tree in solution exlorer results in blank files being opened.
I think it's a bug - and afterall it is a beta.
I also had this problem, and for a while I was thinking it might have to do with my machine being 64-bit, or a permissions issue, but I have no way of confirming it.
However, I was able to solve it by using the template on this Code Project site:
http://www.codeproject.com/KB/gadgets/HeterodoxGadgetTemplate.aspx
The nice thing about the template is that it's setup as a Windows application. When you run the app it handles the local deployment of your gadget and starts the sidebar service (sidebar.exe). I believe this probably gets around a number of permissions issues.
After setting up a new project using this template, I was able to successfully debug the JavaScript using the "debugger" methods explained everywhere else (for example: http://msdn.microsoft.com/en-us/library/bb456467%28v=vs.85%29.aspx).

Resources