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 8517293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:39:28+00:00 2026-06-11T05:39:28+00:00

In Solution Explorer ‘DependentUpon’ project items are normally disabled as children of the other

  • 0

In Solution Explorer ‘DependentUpon’ project items are normally disabled as children of the other item (ex. web.config / web.Debug.config).
The problem I have is when items are dynamically added via nuget/powershell at package install, Solution Explorer doesn’t reload the project so the items don’t show as dependent. Manually closing and reopening the solution or unload/reload the project fix the issue.
I’d like to automate the Project Reload as part of the install.ps1 powershell script but when I do this I get ‘Project Unloaded’ errors and nuget rolls back the install. I think this is because the only way I know how to get the Reload context menu is to unload the project first.

I’m looking for the object that gets invoked behind this call. I think if I could execute directly, I wouldn’t have to Unload the project first.

$dte.ExecuteCommand("Project.ReloadProject")

And here is the full code to unload/reload the project in Solution Explorer

# Reload a project thru dte/SolutionExplorer Window 
# using Unload and Reload Context Menus.

$project = Get-Project
$shortpath = $dte.Solution.Properties.Item("Name").Value + "\" + $project.Name

#following GUID = Constants.vsWindowKindSolutionExplorer
#magic 1 = vsUISelectionType.vsUISelectionTypeSelect
$dte.Windows.Item("{3AE79031-E1BC-11D0-8F78-00A0C9110057}").Activate()
$dte.ActiveWindow.Object.GetItem($shortpath).Select(1)
$dte.ExecuteCommand("Project.UnloadProject")
$dte.ExecuteCommand("Project.ReloadProject")
  • 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-11T05:39:30+00:00Added an answer on June 11, 2026 at 5:39 am

    Similar question answered here:
    Is there a setting in VS 2010 that will allow it to recover open files after a project file changes?
    However, it doesn’t indicate that reload can be called without first calling unload and it doesn’t provide a mechanism for calling directly w/o going thru dte.executecommand.

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

Sidebar

Related Questions

The team explorer for my project looks like this: mytfsserver\mycollection -- Project 1 solution
I created an Add-in project and now I have this in my solution explorer:
When making a .NET project, then you can create folders in your solution explorer
I just created a project so my Solution Explorer looks like this: (source: kalleload.net
I never use Add existing item... feature in Visual Studio's Solution Explorer because it
If you right click on a project in solution explorer and go to General
This is my first time using an XML config file. In the solution explorer
This is what I see in the solution explorer (simple wpf project): This is
I have a solution that contains a WCF service project. In Solution Explorer only
I have an image in my project. In Solution Explorer, I've created a folder

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.