Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange failure when using ProjectFile.GetInterProjectDependencies() #452

Closed
Vidarls opened this issue Dec 12, 2014 · 2 comments
Closed

Comments

@Vidarls
Copy link
Contributor

Vidarls commented Dec 12, 2014

I just took over a project from another team and wanted to put it into our buildsystem (using Project Scaffolding as the base).

I noticed a strange failure when creating nuget packages (using the code from fsprojects/ProjectScaffold#116).

Part of what is done in this code is to calculate interproject dependencies of libary output projects and adding them as nuget dependencies.

For this I use ProjectFile.GetInterProjectDependencies() which failed with the message unable to parse ProjectReference

After reading the code of this function I found that on line 269 (

Private = forceGetInnerText n "Private" |> bool.Parse }]
) the function tries to read a node named Private. It also (due to the use of the forceGetInnerText function) throws an exception when this node is not found.

I checked, (and even tried to re-add the reference) but this node is not created in my project files.

Is there any reason for not reading this node in a more soft manner, IE: If it is present, read it. If not assume False ?

@forki
Copy link
Member

forki commented Dec 12, 2014

probably just a bug. I'm not at my dev box - could you please send a pull request?

@Vidarls
Copy link
Contributor Author

Vidarls commented Dec 12, 2014

Need to catch the bus home soon, I'll see what I can do in the evening.

I did load up one of the test files used in the tests of this feature, and found that all the projectreference nodes there had the private sub node, but VS underlined them and gave a warning that it was an invalid child elemen "Private" so not sure it should even be there.

I suppose making the parsing soft is a safe step anyway, then we can remove it later if it has no use.

Vidarls pushed a commit to Vidarls/Paket that referenced this issue Dec 12, 2014
Fixes issue fsprojects#452.
According to http://msdn.microsoft.com/en-us/library/bb629388.aspx the Private element in question is not
a child element of ProjectReference item.
(Also it was not used anywhere at all)
@forki forki closed this as completed Dec 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants