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

Specify which target framework you want to use from a dependency #477

Closed
JamesNK opened this issue Sep 14, 2016 · 4 comments
Closed

Specify which target framework you want to use from a dependency #477

JamesNK opened this issue Sep 14, 2016 · 4 comments
Assignees
Labels
Feature-Multi-Targeting Targeting and building for multiple frameworks.
Milestone

Comments

@JamesNK
Copy link
Member

JamesNK commented Sep 14, 2016

With project.json there is no way to specify the target framework you want to use from a dependency. It is automatically chosen for you. I would like a way to specify this manually.

For example I have MyLibrary that has netstandard1.0 and netstandard1.1 frameworks.

I want to be able to explicitly say which framework I use from MyLibrary in another project that will run unit tests. That way I can run tests against the netstandard1.0 assembly and netstandard1.1 assembly.

@davkean
Copy link
Member

davkean commented Sep 14, 2016

Great suggestion. @nguerrera Can we put some metadata on the reference to influence this?

@davkean davkean added this to the 1.0 RC milestone Sep 14, 2016
@nguerrera
Copy link
Contributor

Sure! With dotnet/msbuild#1018, we ask the dependency's project for the properties that configure it to best match. We can change this to honor SetTargetFramework metadata that you already set on the reference. So it's trivial for project-to-project refs. Do we need parity for package refs?

@srivatsn srivatsn removed the Bug label Sep 16, 2016
@srivatsn srivatsn modified the milestones: 1.0 RC3, 1.0 RC2 Nov 4, 2016
@srivatsn srivatsn modified the milestones: 1.0 RC3, 1.0 RC2 Nov 18, 2016
@srivatsn srivatsn modified the milestones: 1.0 RTM, 1.0 RC3 Dec 28, 2016
@srivatsn srivatsn modified the milestones: 1.0 RTM, 1.1 Jan 19, 2017
@srivatsn srivatsn modified the milestones: 16.0, 15.3 Feb 28, 2017
@davkean davkean added Feature-Multi-Targeting Targeting and building for multiple frameworks. and removed Feature - Cross Targeting labels Feb 27, 2018
@benaadams
Copy link
Member

This is also useful; for example currently a net452 package will always take prescience over a netstandard2.0 for net471. However may want to force the netstandard2.0 package as it uses newer apis etc

@davkean
Copy link
Member

davkean commented May 28, 2018

This issue was moved to dotnet/sdk#2280

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature-Multi-Targeting Targeting and building for multiple frameworks.
Projects
None yet
Development

No branches or pull requests

6 participants