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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T18:59:02+00:00 2026-05-21T18:59:02+00:00

I am trying to remove the App_Start folder from my project during my NuGet

  • 0

I am trying to remove the App_Start folder from my project during my NuGet package install. The documentation for NuGet here:

http://nuget.codeplex.com/wikipage?title=Creating%20a%20Package

Says:

$project.Object is the equivalent of http://msdn.microsoft.com/en-us/library/ms170626.aspx.

Which I am not able to find much information of that interface that is of much help to me.

I have the following Powershell script which successfully removes the folder and files:

param($installPath, $toolsPath, $package, $project)

$DirInfo = New-Object System.IO.DirectoryInfo($installPath) 
$appDir = New-Object System.IO.DirectoryInfo($DirInfo.Parent.Parent.FullName)
$fullPath = [IO.Path]::Combine($appDir.FullName, $appDir.Name, "App_start")
Remove-Item $fullPath -recurse

(I know the pathing here isn’t guaranteed, but this package is for internal use only)

But the project still has a reference to the items and therefore the items appear with the yellow warning because Visual Studio believes that the items are part of the project.

What I need is a way to remove a reference to those items from the project programatically. Any ideas?

  • 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-05-21T18:59:03+00:00Added an answer on May 21, 2026 at 6:59 pm

    Ok, I’m absolutely sure there’s a better way than this, but I’ve never used NuGet or Powershell until today… :/

    I just ran this in my Package Manager Console:

    $DTE.Solution.Projects | ForEach { $_.ProjectItems | ForEach { if ($_.Name -eq "Controllers") { $_.Remove() } } }
    

    It looped through all projects items looking for a top-level item called “Controllers” and then removed it from the project. Pretty sure you could just change this to “App_Code”.

    Edit: Friend of mine (who knows a little more Powershell than me) sent this:

    $DTE.Solution.Projects|Select-Object -Expand ProjectItems|Where-Object{$_.Name -eq 'Controllers'}|ForEach-Object{$_.Remove()}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are trying to remove the global.asax from our many web applications in favor
I'm trying to download my data from App Engine. As suggested here , I'm
I have a string of text that I am trying to remove from a
I was trying to remove all the lines of a file except the last
I'm trying to add a class to the selected radio input and then remove
Because regular expressions scare me, I'm trying to find a way to remove all
Im trying to access a web service from a remote computer. I managed to
I am trying to add my program shortcut to an existing folder in the
I am trying to add some administration scripts to a Zend Framework project, that
i have a leak issue in my app. I'm trying to add and remove

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.