Permanently setting environment variables for VC command line environment - visual-studio

I am using VC command-line utilities (cl.exe), and I am getting annoyed by the fact that I have to manually run vcvars32.bat whenever I restart my console... Is there a way to automatically run a batch file on console start-up? Thanks!
P.S: I am using Visual Studio 2010 version on Windows 7.

Check in the start menu under Visual Studio 2010/Tools or thereabouts; there should be a shortcut to a console that automatically runs the batch file.

Got it:
http://msdn.microsoft.com/en-us/library/ms229859.aspx
Click Start, point to All Programs, point to Microsoft Visual Studio, point to Visual Studio Tools, and then click Visual Studio Command Prompt.

Related

How to fix context menu in Solution Explorer in VS 2022

After installing some extensions for SSIS and SSRS, the refresh option is showing up 4 times in the context menu. How do I remove them? This only shows up when right clicking a file.
Looked for appropriate settings in Tools/Customize/Commands/Context menu/. But couldn't find it.
You could try closing all instances of Visual Studio and then from the developer command prompt run
devenv /Setup
That will sometimes fix issues from extensions.
See the docs for devenv.exe (Visual Studio) command line switches at "Devenv command-line switches" and "Devenv command-line switches for VSPackage development".
A different step to try is to run the Visual Studio Installer and run a 'Repair'.

How do I create a batch file that supports an older version of Visual Studio

I have been building Smart Device application on Visual Studio 2008 and have been using a batch file to do so.
This has been working until I have installed Visual Studio 2015 and I wanted to still build and debug the solution via Visual Studio 2008 because Visual Studio 2015 doesn't support Smart Device development. However, using the same batch file I can no longer do so.
I am looking for a way to be able to target the devenv of the older version of Visual Studio for the batch file without uninstalling Visual Studio 2015, because I too have projects built on that version.
NOTE: I can run Visual Studio 2008 perfectly fine and using their on-click build tool it builds fine.
The batch file is probably picking up environment variables (INCLUDE, LIB etc) set up by VS 2015, which the 2008 toolset will not work with.
The Visual Studio 2008 menu should have a Visual Studio Tools submenu. Run Visual Studio 2008 Command Prompt from that submenu, which will open a cmd console with the VS 2008 environment set correctly. Run your batch file at that prompt.
You can automate it by writing a small batch file to first execute vcvarsall.bat (which is what the menu command does), then run your batch.
#call "<path-to-vs2008-install-directory>\vcvarsall.bat" x86
#call "<your-batch.bat>"

Need Visual Studio Command Prompt

I am working on deploying a SharePoint web part. I am working on the server via remote desktop connection, and needed to compile a .dll file using Visual Studio Command Prompt. I discovered that the server only has Visual Studio 2010 Shell, and that lacks VS Tools including Command Prompt. I tried researching this issue and all of them dealt with older VS that had to add it via Tools menu, which is ineffective since Shell has only the application and nothing else.
What I need to do specifically on VS Command Prompt is add a webextension.dll to Assembly.
How do I add VS Command Prompt to a VS Shell? Could I use regular command prompt as a workaround?
Can you add the Visual Studio 2010 tools?
then add to the Assemblies:
References>Assemblies>Framework>System.Web.Extensions
HTH

Visual Studio 2010 Unknown Error on Startup

I'm trying to launch Visual Studio 2010 from my desktop and I just get this error box popping up saying "Unknown Error"...
Anyone have an idea why this might happen?
I just fixed it, I uninstalled and reinstalled my version of the .NET Framework (v4.0). And then when I again tried to launch Visual studio it started up without any issue.
Here's some things you can check:
Temporary de-activate all Addins
Temporary disable all Extensions
Check the Event Log for any errors
Reset your settings
Start with /ResetSkipPkgs
Based on your comment below, if you can't find the DevEnv.exe when you have opened a VIsual Studio Command prompt, I would suggest you to re-install Visual Studio as it indicates your installation (paths) are in a bad state.
And here are some other things you migh want to check:
VS 2010 Crashes on Startup with "Unknown Error"
Visual Studio 2010 quit working...now gives me an "unknown error" dialogue when launched
Visual Studio 2010 Startup Errors
Visual Studio 2010 crashes on startup after installing SP1
Open Visual Studio Command Prompt with Administrator permission and type the following,
devenv /ResetSkipPkgs
the Solution of this problem ist very simple.
Install VS 2010 on a other machine and export HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0 to a file. Copy the file to your target machine and rename the path above to ".old", then double click your exported reg-file and wait a time....
After this my Visual Studio was starting correctly.
The other solution, that people post wont work in my case.
I hope this will help some body.
Enjoy
Sven
I had the same problem.. Instead of completely uninstalling .net framework, I just repaired the .net framework from the repair/uninstall option available in Control Panel of my Windows 7 Ultimate pc. Finally I got another error that, Visual Studio could not create AppData folder in my system. Then, I right click the Visual Studio icon and selected Run as Administrator. This worked for me!! Now, Visual Studio 2010 is working on my pc!! Try this out if you want..

No templates available when creating a new project in Visual Studio

"No template information found. See the application log in Event Viewer for more details. To open Event Viewer, click Start, click Control Panel, double-click Administrative Tools, and then double-click Event Viewer."
That's the error message I get when I try to create a new project or solution.
How can this be resolved?
I used a solution presented to me from other sites. One of them said to reinstall templates.
I did the following:
In the command prompt I typed: cd C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE
Then I typed: devenv /installvstemplates
I took a minute but after it completed I opened Visual Studio and tried to create a new project. All my project templates were back in order, including additional templates like Workflow, SharePoint and Silverlight.
Link to other source
Start Menu --> Microsoft Visual Studio 2008 --> Visual Studio Tools. Right-click over the Visual Studio Command Prompt shortcut and make sure you select Run as Administrator. Once the VS Command Prompt comes up, execute the command without Quot,
"devenv /installvstemplates"
"devenv /resetsettings"
And that worked out.
Run Following command and it will restore templates.
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE>devenv /installvstemplates
This may not match the original posters exact symptoms but I was seeing a blank screen after clicking Create a new project (VS 2019). Discovered that the install of Visual Studio had 'finished with errors' (paraphrasing there - now I've fixed the issue I can't see the exact error message) anyhow digging into it I found that the C++ redistributable had not installed (even though I'm a C# dev that's still important to VS!)
If I tried to install this as a standalone I got an Access Denied error (even if running as Administrator). Digging into the VS install logs I found a similar report.
Anyhow after a fair amount of Googling a few responses pointed to Virus software preventing the C++ redistributable from installing (in my case McAfee). Once that was removed a repair of VS resolved the issue :)

Resources