How can I select GTAV in Visual Studio Graphic Debugger applications? - visual-studio

I am using Visual Studio Graphics Debugger in VS2017 and only shows MS apps. I even selected it in the edit and added it and GTAV is in running state but can't be selected:
Update: (Regarding Gareth's answer):
I already showed my directX control panel, there's nothing further I could do:
Also, in other debug options, after clicking, it shows the same thing as the first window:

It looks like the limitation is not related to the debug targets all being MS, as Candy Crush is by King.
What they do seem to have in common is that they've all been installed the same way, probably through the Windows Store as App Packages, while GTA was installed with an executable installer.
Consider looking in the "Other Debug Targets" or "Attach to Process" menus for attaching to non-App Packages. The DirectX Control Panel menu item may also be worth reviewing.

Debug Installed App Package only works on Universal Windows Platform (UWP) apps. GTA V is a Win32 desktop app, so it would not be expected to show up in that menu.
You can run VSGS on a EXE by opening it with Visual Studio, and then using Debug / Graphics -> Start Graphics Debugging. It's quite common, however, for Win32 desktop applications to use 'ripple' launchers, so the EXE you start isn't actually the Direct3D game EXE.
Applications are also free to request that Visual Studio not support capturing them via an API, which is possible here as well. This is done via the D3DPerf_SetOptions(1) method, use of the D3D11_CREATE_DEVICE_PREVENT_ALTERING_LAYER_SETTINGS_FROM_REGISTRY flag, or by reacting to the value returned from IsAnnotationEnabled:GetStatus or ID3D11DeviceContext2::IsAnnotationEnabled.

Related

How do I disable a failed assert being a debug error in Visual Studio 2017?

I'm not an Visual Studio enthusiast (I prefer Linux/own tools), but I have to use it to keep up with my work team. Accessible Microsoft documentation is lacking, and I have to spend a lot of time just to make literally every standard bells and whistles work in a natural way.
I couldn't even find how to disable the annoying bell sound from beeping on every assert debug break.
Is there a simple way to disable it altogether, without changing the code (overloading asserts) from within the Visual Studio functionality?
Also, why does Visual Studio consider failed asserts such big deal that it needs to popup a dialog and play a sound in the first way? Is assert programming incompatible with VC++ development and if so, why?
Platform
VC++ 2017+ standard, cassert asserts
Windows 10, Visual Studio 2017, and a console C++ application.
Yes, there is a simple way. But it will also affect other parts of Windows (by disabling a sound that is used outside of Visual Studio).
Disable the sound for Windows sound Critical Stop.
HowTo
Windows 10:
Window + sounds → select "Change system sounds" → select "Critical Stop" (in the "Windows" section, the first section) → select "(None)" in the "Sounds" dropdown → press Apply.
It takes effect immediately after pressing Apply.
Verification
To verify that Windows sound "Critical Stop" affects the behaviour of the debug assert dialog, set the sound to some distinct sound, like "Ring04.waw".
Platform
This was tested with Visual Studio 2012 on Windows 10, a Windows Forms application in C# (.NET), and the code line Trace.Assert(false, "Break in...");.

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.

Unable to open visual basic 6 project on visual basic 8

I've created a project on VB6 at but when I am opening it on VB8, it shows the following error:
How to fix it?
As listed by GSerg in the comments, this appears to be a known issue documented in Microsoft Knowledge Base article 896292: You receive a "The remote procedure call failed" error message when you upgrade a Visual Basic 6.0 project to Visual Studio .NET 2003 or Visual Studio 2005 on Windows Server 2003 SP1 or on Windows XP SP2
To reproduce the solution here:
Cause
This behavior occurs because the VBU.exe tool has compatibility issues with the Data Execution Prevention (DEP) option.
Note: The VBU.exe tool starts when you upgrade the Visual Basic 6.0 project by using the Visual Basic Upgrade Wizard in the Microsoft Visual Studio .NET IDE.
Workaround
To work around this behavior, add the VBU.exe tool to the DEP exclusion list. To do this, follow these steps:
Click Start, click Control Panel, and then double-click System. The System Properties dialog box appears.
Click the Advanced tab, and then click Settingsunder Performance. The Performance Options dialog box appears.
Click the Data Execution Prevention tab. Verify that the Turn on DEP for all programs and services except those I select option is selected
Note By default, the Turn on DEP for all programs and services except those I select option is selected in Microsoft Windows Server 2003 Service Pack 1 (SP1).
Click Add. Locate and then click to select VBU.exe. Click Open.
In the warning box, click OK. VBU.exe now appears in the DEP program area.
Click Apply, and then click
OK. A dialog box appears that states that you must restart the computer for the setting to take effect. Click OK.
Try do divide your project to small projects(or comment large part of your project) a try again in each small project.
The idea is to find the function that is production the error.
My intuition is telling me that maybe is a DLL or OCX problem. Try to see all the external DLL or OCX calls and remove from the original project and try again the upgrading.
Most developers who move their VB6 projects to .Net do not even try to port them over. Even with third-party "conversion" software, the effort can be incredibly tedious. So much so, that most developers simply re-write the application completely. Consider it a move to a different language. In fact, some developers use that opportunity to port it to C# instead. I'm a die-hard VB6 user/fan but were I to attempt to port my 200 form accounting application, I'd just re-write it in C#. I started porting it, tried third-party conversion apps, just wasn't worth it.

Debugging in Unity (C#) + Visual Studio Code Work on OS X?

I really like the idea of working with Visual Studio, C# and Unity on OS X.
Has anyone made debugging with C# in Unity work with Visual Studio Code on OS X?
Yes it works absolutely fine. Unity is C#, JavaScript or Boo. So, you don't need .NET for it. Unity uses Mono runtime. So, an existing VS project can be opened in Unity for Mac OS X.
EDIT
Here is a link that helps you to attach a debugger to the VS endpoint.
http://www.yunspace.com/2015/01/19/integrating-visualstudio-with-unity3d-on-mac-using-vstools/
You can try VS Tools for Unity too.
http://unityvs.com
UPDATE
There is this awesome Unity Plugin by dotBunny that solves the problem and integrates Code with Unity tools.
Hi the solution is https://github.com/dotBunny/VSCode This plugin works on both MacOS and Windows and gives you the following capabilities:
•An option to enable VS Code integration (Editor –> Assets –> Enable Integration), this updates your solution files and (more importantly) keeps them in sync. This also sets the preferred external tool editor in the Unity preferences.
*Note, the old “Sync MonoDevelop” option is now gone in the Unity editor from V5.2
•It writes out the necessary (and sometimes hard to find) VS Code configuration files, including the ability to hide “non-code” files in the editor (hides things like .sln, .csproj and the ever present unity .meta files)
There are a couple of other settings in there to help speed up the integration.
•Automatically launches VS Code direct to your project folder, EVERY-TIME. no longer do you have to worry about keeping that window open, or switching around if you work on multiple projects
One thing to be aware of, once you enable the VSCode integration, changing your preferred code editor in the External Tools preferences will have no effect as the plugin takes over opening code files. If you want to use another editor, you’ll have to disable the integration first.
These are just the main highlights as there are more features in there as well.
Currently you need to download the plugin files from GitHub
An existing Visual Studio solution can be build and debugged with Visual Studio Code on the Mac with Mono. You have to use the launch.json and tasks.json files.
I described it on my blog: Compile and Debug
To build Unity in Visual Studio Code, you can hook up Mono xbuild compiler as a task runner, so you don't even have to leave IDE to have errors and warnings.
See https://twitter.com/_eppz/status/846859856787259392 for more.
It's a little unstable. But it's possible from recent VSC version.
1) Install this VSC Unity plugin-in.
https://github.com/dotBunny/VSCode/
2) Follow these commands. (Step 1, 2 and 3)
https://code.visualstudio.com/Docs/runtimes/unity
3) After you complete the settings, launch the VSC using Unity menu.
Assets/Open C# Project in Code
4) Play the Unity project.
You can see the debug port number on the unity console.
And the project's launch.json file will be renewed automatically.
To open launch.json, click option icons.
the file exists in this folder.
.vscode/launch.json
sample.
{
"version":"0.1.0",
"configurations":[
{
"name":"Unity",
"type":"mono",
"address":"localhost",
"port":56621
}
]
}
5) Start debug in VSC debug tab.
That's it. Hope this help.
Update, 2016 - the petition was popular enough that some VS Code extensions have been written for it: https://marketplace.visualstudio.com/search?term=unity&target=VSCode&sortBy=Relevance
Petition for it on the Visual Studio UserVoice page: http://visualstudio.uservoice.com/forums/293070-visual-studio-code/suggestions/7752702-unity-integration
[Feb 2017] It is now possible to do this without the dotBunny plugin.
i.e. Support is built into Unity natively.
Just to repeat, you don't need to fiddle with Unity, just VSCode.
Instructions here
Instructions are incomplete though, and I didn't take screenshots (please do!), but basically what I did was:
(...and please improve these instructions as you go, I'm working from memory...)
I deleted/renamed my .vscode/Launch.json file, as per the link.
Double-click on some file to bring up the project in VSCode (maybe first make sure that in Unity's settings you have selected VSCode as your default code editor)
clicking the bug icon then the cogwheel, as per the link.
I had to install that vscode-unity-debug plugin in VSCode, just filtering the search with 'unity' found it.
I then had to press the green 'play' triangle.
I set a breakpoint in my code.
Now over to unity and press play, and the breakpoint gets hit.
The Unity Debugger for Visual Studio Code is working, but doesn't work well enough when doing any kind of serious work for now. I really hope they will improve it in the future as I prefer VS Code over VS.
Current problems I encountered
-Sometimes I cannot step in a function, the debugger will hang until you detach
-no local variable, you have to watch everything
-some more complex variable have no support, so you can't see what is inside
-A bit overall unstable with unexpected behaviours.
What I love about it,
Attaching & Detaching is a breeze. Just press a button, allowing to attach and detach quickly as needed. e.g. At the beginning of the program I work on, there will be an bunch of exception. I can detach and attach quickly to skip the exceptions.
The problems with it are too constraining as it currently stands, I had to go back to the classic Visual Studio.

How to close a crashed Visual Studio debugger?

I feel pretty ridiculous having to ask this, but is there an easy way to close Visual Studio while it's debugging?
I'm debugging my application, and when switching to full screen it crashes. I am unable to alt-tab to visual studio to stop the debugger, and I'm unable to pull any other windows on top of the full screen application.
I can, however, see the start bar. I can right click on visual studio and click close, but it does nothing (same goes for the debugging application).
I'm unable to get the task manager to show in front of the full screen application.. However, I'm on Windows 8 and I've noticed the Metro interface still works (and all metro apps). If I could find a little command prompt metro app I'm sure I could get around this, but I'm unable to.
Is there an easier way to resolve the issue without having to restart my pc each time I crash?
Almost forgot to mention, I'm on Visual Studio 2013
Edit: Forgot to mention, I'm programming on-the-go on a laptop; I only have the one monitor for this situation
I found a solution:
I can toggle focus to Visual Studio via Windows' Alt-Tab hotkey. This won't bring up Visual Studio, though.
Usually the problem is an unhandled exception, which requires me to hit "break." Since I gave Visual Studio focus, I can hit enter to select break.
I then use the Shift+F5 hotkey to stop the debugger
You might be able to use Developer Command Prompt - see MDbg.exe (.NET Framework Command-Line Debugger) to debug and kill your process

Resources