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?

Edit
Report