Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8203265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:29:30+00:00 2026-06-07T07:29:30+00:00

How do I get the default project creation directory from within a Visual Studio

  • 0

How do I get the default project creation directory from within a Visual Studio 2010 extension? By default this directory is:

C:\Users\<username>\Documents\Visual Studio 2010\Projects

I’m guessing this is done via the Tools->Options window, but I don’t know how to get at this via the SDK.

At first glance the following looks like it should get me close:

DTE2 dte = CType(GetService(typeof(SDTE)), DTE2);
Object props = dte.Properties("Projects and Solutions", "General");

But I get the following error:

System.Runtime.InteropServices.COMException was unhandled by user code
ErrorCode=-2147352565
Message=Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T07:29:31+00:00Added an answer on June 7, 2026 at 7:29 am

    Found it:
    http://msdn.microsoft.com/en-us/library/ms165642.aspx

    After Visual Studio has been run once, the property item names for the current instance of Visual Studio are stored in the following Windows registry key: HKCU\SOFTWARE\Microsoft\VisualStudio\10.0_Config\AutomationProperties. This location always has the definitive list of names. The category names are the names of the subkeys of the AutomationProperties key (Database Tools, FontsAndColors, and so on). The page names are the
    names of the subkeys of the category keys. For example, the FontsAndColors category contains the Dialogs and Tool Windows, Printer, and TextEditor pages. You can view the registry by using the
    registry editor.

    And here’s the code to get the values I’m looking for:

    string defaultProjectPath = (string)(DTE.Properties("Environment", "ProjectsAndSolution").Item["ProjectsLocation"].Value);
    

    Note that the values in the registry don’t match up with what you see in Visual Studio so a little detective work is required to get to the exact value that you’re looking for. I assume that it’s setup this way due to backward compatibility.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code to get the default constructor: Public Function f(ByVal t As
I want to get the current page URL from my default_popup page like this:
In the file main.html , in default project created by Play! , there's this
Is there a way to transfer a Visual Studio project to the MonoDevelop environment?
Basically trying to get the default sample project (which is linked to here )
I want to get Default Windows Forms Unhandled-Exception Dialog whenever my C# application encounters
When do class members get their default values in c++11? Is the following code
I am trying to get a default query to implement upon page load but
Possible Duplicate: Default value of a type In C#, to get the default value
I get the following results on my machine: Python 3.2.2 (default, Sep 4 2011,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.