nikhilk / scriptsharp

Script# Project - a C# to JavaScript compiler, to power your HTML5 and Node.js web development.
http://scriptsharp.com
Other
658 stars 182 forks source link

ScriptSharp.PlaceHolder.txt file not found error during TFS checkin #350

Open theoutlander opened 11 years ago

theoutlander commented 11 years ago

If I recall correctly, installing a project reference adds a file called ScriptSharp.PlaceHolder.txt to the project. However, it is deleted at some point and I believe it's not removed from the project/solution and it results in a TFS checkin/shelfing error that the file is not found (which is true as it doesn't exist on disk).

I can't pinpoint where the problem is, but my guess is that during uninstallation it will need to be removed from the project file as well. I think I see that in code, but not sure if it is broken generally.

// remove placeholder file $placeholder = "ScriptSharp.PlaceHolder.txt" $project.ProjectItems.Item($placeholder).Remove() Split-Path $project.FullName -parent | Join-Path -ChildPath $placeholder | Remove-Item

Seems like the file is not removed from the project. Btw, what purpose does that file serve? Thanks!

nikhilk commented 11 years ago

Every nuget package needs to have at least a content file. Nuget limitation.

The 2nd line in the script you copied above is supposed to do the removal from the project (so not sure why you say it isn't removed - does an item entry linger in the csproj after saving the project?), and the 3rd line is supposed to delete the file.

theoutlander commented 11 years ago

Yes, the file reference stays in the project.

nikhilk commented 11 years ago

Is that a TFS thing? I've never seen that on my end. This install script is pretty standard for anything that needs to add a target file import to the project.

I expect nuget to have done the project checkout and the TFS interaction since it does the item adding.

Have you tried on a project without TFS to see if there is a difference?

theoutlander commented 11 years ago

It might very well be a TFS thing. I've never had that problem on github.