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

net48 requires explicit references to framework assemblies #15480

Closed
JensNordenbro opened this issue Jan 25, 2021 · 11 comments
Closed

net48 requires explicit references to framework assemblies #15480

JensNordenbro opened this issue Jan 25, 2021 · 11 comments
Milestone

Comments

@JensNordenbro
Copy link

When building a project for net48 target we had to explicitly add assemblies that we did not have to do for net5.
It expect that symmetry applies or that this is documented (maybe it is?!)
This subset of a csproj comes from a multitargeting application:

image

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Jan 25, 2021
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@sfoslund
Copy link
Member

What is your goal, are you referencing these assemblies in your code? If so, you probably want to use nuget packages instead of direct references to the dlls

@sfoslund sfoslund removed the untriaged Request triage from a team member label Jan 28, 2021
@sfoslund sfoslund removed their assignment Jan 28, 2021
@sfoslund sfoslund added this to the Discussion milestone Jan 28, 2021
@JensNordenbro
Copy link
Author

My goal is to port an application from net48 to net5 while at the same time keeping the net48 targeting until net5 is done and the net48 generation is phased out.

I have a theory the problem can be thirdparty assembly references that not yet has not moved to net core.
These references however are perfectly fine for a smaller subset of the application. It not only compiles but also works fine on both net48 (no wonder) and net5 (more of a wonder).

This problem only occurs on WPF targeting assemblies.

I would have expected this to be problematic for net5 but it is the net48 that complains...

I will validate my claims on monday when I can study the sources.

@JensNordenbro
Copy link
Author

also these explicitly refered net48 assemblies are part of net48 and as such should not have to be specified..

@JensNordenbro
Copy link
Author

JensNordenbro commented Jan 30, 2021

basically symmetry is expected and this have a "arbitrary" touch to it until explained.

@sfoslund
Copy link
Member

sfoslund commented Feb 1, 2021

@wli3 is this expected for net framework or is something off here?

@wli3
Copy link

wli3 commented Feb 1, 2021

This is expected. Some API will not be available in core dotnet/core#838. The goal of net5 is not 100% compatible with net48. If you need to maintain both net48, and net5.0, you need to use the common set of APIs (like netstandard2.0) with help of nuget package (some API available in net48 are shipped separately as nuget packages). Or you need to compile conditionally.

@JensNordenbro
Copy link
Author

JensNordenbro commented Feb 2, 2021

But the apis are available in both net5 and net48...

It is only 48 requiring tinkering.

@wli3
Copy link

wli3 commented Feb 2, 2021

@JensNordenbro could you give me an API example

@JensNordenbro
Copy link
Author

I will try; huge project though... all i have is the dll:s mentioned.

Also I will try to upgrade to net6-preview1.

I wil get back to you!

@JensNordenbro
Copy link
Author

We will go with the NuGet route for now regarding the extra references.
If this works this detail will not matter in the long run...

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

3 participants