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

PackageReference support in FSharp projects #7743

Closed
le-agould opened this issue Jan 28, 2019 · 9 comments
Closed

PackageReference support in FSharp projects #7743

le-agould opened this issue Jan 28, 2019 · 9 comments
Labels
Resolution:External This issue appears to be External to nuget

Comments

@le-agould
Copy link

Hi,

Could you give some indication as to when support for PackageReference project directive will include F Sharp projects - Thanks...

@heng-liu
Copy link
Contributor

When I check in VS2017(15.9.6), all F# projects are .Net Core and .Net Standard, so all of them support PackageReference. Not sure which version of VS do you use and what kind of project do you create?
/cc @cartermp

@heng-liu heng-liu added the WaitingForCustomer Applied when a NuGet triage person needs more info from the OP label Jan 29, 2019
@cartermp
Copy link

@heng-liu is correct, F# has full support for PackageReference provided you are using .NET SDK-style projects.

@le-agould
Copy link
Author

@cartermp / @heng-liu - Thanks for your reply, however, when I manage NuGet Packages in Visual Studio Professional 2017 (Latest v15.9.5) F# projects ignore the "Default Package Management" setting of "PackageReference" and creates/adds to Packages.config file. This is contrary to C# projects which honours the setting and adds a PackageReference to the project file.

@le-agould
Copy link
Author

Updated to Visual Studio Professional v15.9.6 and same - packages.config is created/updated for F# projects, ignoring the "Default Package Management" setting of "PackageReference"

@cartermp
Copy link

@le-agould Are you using .NET SDK-style projects? If you're not, then it will still use packages.config. F# support for PackageReference is with .NET SDK-style projects only.

@le-agould
Copy link
Author

@cartermp - Hi Phillip - The solution is a C# .NET Framework v4.6 class library with NUnit based unit tests written in F#. Not sure what you mean by ".NET SDK-style projects only."

@cartermp
Copy link

@le-agould .NET SDK-style means a project type that uses the .NET SDK. You can see an example if you create a new .NET Core project, or use dotnet new with one of the templates that comes with the .NET CLI.

I suspect your NUnit tests are using the non-.NET SDK style projects based on what you are saying. The resolution to this is to create a new project (perhaps with dotnet new nunit -lang F# and use PackageReference there. We do not have plans to support PackageReference for non-.NET SDK style projects in F#.

@heng-liu heng-liu added Resolution:Question This issues appears to be a question, not a product defect Resolution:External This issue appears to be External to nuget and removed Resolution:Question This issues appears to be a question, not a product defect WaitingForCustomer Applied when a NuGet triage person needs more info from the OP labels Jan 30, 2019
@heng-liu heng-liu closed this as completed Feb 1, 2019
@le-agould
Copy link
Author

@heng-liu - For your information...
MSBuild appears to support PackageReference for F# projects and will restore packages when specifying the target "restore" however Visual Studio does not recognise the references and shows them as missing references, unlike equivalent C# projects.
This is a bit misleading and confusing, appearing to be partially implemented.
Using Visual Studio to restore packages ignores the F# project PackageReference(s), however using MSBuild with -t:restore target does honour the F# PackageReference(s) and works as expected.

@Happypig375
Copy link

Bump. Please fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution:External This issue appears to be External to nuget
Projects
None yet
Development

No branches or pull requests

4 participants