I am trying to find information on single-file generator changes (especially how to register) in Visual Studio 2017. Any help would be really appreciated.
I think the registration system is pretty much the same. You can find more details here
In Visual Studio 2017, the registry settings are stored in a private registry files.
This enables multiple installations of Visual Studio side by side, on the same machine.
However, these entries are no longer available in the global registry file.
Here is how to open such a file in regedit:
Close Visual Studio
Start Regedit.exe
Select the HKEY_LOCAL_MACHINE node
From the main menu, select File -> Load Hive... and select the private registry file. That file is stored in the Local App Data
%localappdata%\Microsoft\VisualStudio\<config>\privateregistry.bin
where <config> coresponds to the configuration hive you would like to use
It will prompt for a name - that represents the name that will be displayed under (e.g. IsolatedHive)
Now you should be able to browse the registry under the hive you created
Before launching Visual Studio, you need to unload it: From the main menu File -> Unload Hive before attempting to run VS (otherwise regedit keeps the file locked, and Visual Studio will fail to launch)
Related
In Visual Studio, I want to inspect environment variables of a process launched from it, like in Process Hacker or Process Explorer.
VS gives very advanced debugging capabilities, probably I'm missing something.
Background.
I've got a C++ program built by Visual Studio 2019.
It fails if launched from the Visual Studio IDE, but runs successfully if launched from a .cmd script. Cmd script sets additional environment variables, and I want to mimic this behavior with setting those variables from Project properties -> Debugging. I have done it before, and everything was working.
Now something has changed, and I'd like to figure out what.
Security policies of our company don't allow me to use Process Hacker and ProcessExplorer. If I try to launch any of these programs they are terminated by the corporate soft, installed on my PC.
Also, I'd like to avoid adding code that would retrieve these variables and print them.
So, in Visual Studio, is there something that can show environment variables for me?
Update The issue is indeed in environment vars. Specifically in the way, Visual Studio sets them. No crashes, if I set required variables globally from system control panel. However, something strange happens if I set them via project properties of Visual Studio.
In the debug mode, you can save a process dump (Debug - Save Dump As - Minidump with heap) and then inspect this .dmp file with a hex editor (or Notepad if file is small) searching for an environment variable name.
Working in Visual Studio 2017; I have added a class library in my project. Now I want to add an app.config file.
When I try to add by "Add new Item" but config file is missing from item list.
How can I do it?
You probably forgot to install workload .NET desktop development.
Go to installation, click to modify and include the workload .NET desktop development.
Check image of installation screen
Just right click your class library. Click on Add -> New Item and you should find Application Configuration file
Note:
If you have a solution without any project or all project are unloaded, you would not find the Application Configuration File
If you are missing visual studio templates,then Close all instance of Visual Studio and Open visual studio command prompt and type,
devenv /installvstemplates
Press Enter. Let the process be complete and now open visual studio. You will get all missing templates under Visual Studio installed templates.
I couldn't add app.config using the GUI tools for my web project. However, I have added the app.config file manually and the build process picked it up and used it.
Files produced by Visual Studio 2012's profiler are very large in some cases. These files have the extension ".vsp"
These files are being generated after I am starting the profiler using the "Launch Performance Wizard" under the "Analyze" menu in Visual Studio 2012 Professional. Visual Studio is creating VSP files for analysis in the same directory as the solution (.sln) file.
My projects are stored on a somewhat small (only 100GB) SSD disk and Visual Studio rapidly fills them up.
I have a much larger (2TB) spinning disk that I would like Visual Studio to use for the profiler.
Short of moving the entire solution to the larger, slower data drive ... Is it possible to configure the location of Performance Session Files (VSP) in Visual Studio 2012?
I have found ways to set a path AFTER the VSP files are generated, but seems only to impact the location for the filtered reports.
Until I can find a way to configure the storage location BEFORE the VSP file is generated, I will be limited to profiling sessions under 20GB (my free space on the drive that VS is defaulting to.) With the instrumentation tool, 20GB is only a few minutes of heavy use of the application.
There is an HowTo in the MSDN site: Set Profiling Data File Name Options. It refers to Visual Studio 2015, but worked for me in Visual Studio 2013.
Shortly:
Open the Performance Explorer window from Analyze -> Windows
Right-click the name of the performance session, and then click Properties
Click General
Under Report, you'll find settings about report location
I am trying to build a cpp project. On the project resources section there is a resource whose relative path is something like
$(QPID_BUILD_ROOT)\src\windows\resources\org.apache.qpid.messaging.rc
Where am I suppose to define this variable ? I mean where does VS2010 read this variables value from ?
These are environment variables. You can set them for user only, or for the whole system. You also can set what you want "ad-hoc", for example (assuming that your Visual Studio is installed in c:\Program Files\Microsoft Visual Studio 10 and that you want x86 build environment):
Go to start
Type cmd.exe
At the command prompt:
"c:\Program Files\Microsoft Visual Studio 10\VC\vcvarsall.bat" x86
set QPID_BUILD_ROOT=[some path]
Launch Visual Studio IDE: devenv
In the Visual Studio IDE you can use a dropdown list (e.g. on one of the VC++ directories) and the click Edit. In the dialog window click Macros - this will show you all the variables (including the one set above) currently available to Visual Studio.
Of course you don't have to set entire build environment (as shown in 3), this step is only needed to be able to just type devenv instead of typing the whole path to devenv.exe in 5.
Im assuming that you know how to set environment variables for user or the whole system and that you know that you need (at least) to lauch any application again (or even login/logout or reboot) in order for that application to inherit those new variables.
i have a strange problem.
the dll that i built (lets call it my.dll) in c++ visual studio 2010 uses a third party library (say tp.lib) which in turn calls a third party dll (say tp.dll).
for debugging prupose i have in configurationProperties->debugging->command: Excel.exe
and configurationProperties->debugging->commandArguments: "$(TargetPath)"
in my computer i also set PATH variable to the directory where tp.dll resides
now when i hit the F5 in visual studio excel opens up with my.dll and crashes giving me a "cannot open in dos mode" error. the reason this happens is tp.dll is not deployed when debug version of my.dll is deployed.
when i open an instance of excel seperately and manually drop the debug version of my.dll then everything works fine and i can see all my functions that i wrote in my.dll
the only issue is now i do not know how to debug becuase i do not know how to attach visual studio to the instance of excel i opened up seperately.
my question is:
1> how can i attach visual studio to an already opened instance of Excel
or
2> how can i hit F5 and still make Excel pick up the required tp.dll from the directory specified in the PATH variable before it starts to deploy my.dll.
any of these two will allow my to step through the code for the purpose of debugging.
thanks in advance.
okay i figured out a way to do it by trial and error
1>build the debug dll.
2> open instance of excel and drop my.dll from the debug folder to it.
3> in visual studio 2010 : properties->configurationproperties->debugging->command = excel.exe
4>properties->configurationproperties->debugging->Attach = yes
and now you hit F5 in visual studio. this will attach the visual studio editor to the running copy of my.dll which will allow to to step through the code.
Unless you are using the Express edition you can attach visual studio to a running process.
I would copy tp.dll into the folder containing my.dll.