Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Target framework issue when used in .NET 4.7.2. project #269

Closed
Metalfusion opened this issue Nov 6, 2023 · 3 comments
Closed

Target framework issue when used in .NET 4.7.2. project #269

Metalfusion opened this issue Nov 6, 2023 · 3 comments
Assignees
Labels

Comments

@Metalfusion
Copy link

I'm trying to use the SharVectors.Wpf package version 1.8.2 in my Windows WPF application which targets .NET Framework 4.7.2.
The build seems to fail because these indirect dependencies are built targeting .NET Framework 4.8.

Could the target framework be lowered to e.g. 4.7 or 4.5?

I think if I need to solve the issue myself the options are:

  • Upgrade my WPF application to target .NET 4.8
  • Try to fork and retarget the libraries myself, then use my fork build instead of the official Nuget package.

Both would be inconvenient, and the library page here claims to support .NET Framework versions older than 4.8.

2023-11-06T06:34:40.9836088Z 120>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3275: The primary reference "D:\_w\1\s\Output\Release\x64\MyProject.dll" could not be resolved because it has an indirect dependency on the assembly "SharpVectors.Rendering.Wpf, Version=1.8.2.0, Culture=neutral, PublicKeyToken=d0902381100df30e" which was built against the ".NETFramework,Version=v4.8" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.7.2".

2023-11-06T06:34:40.9851799Z 120>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3275: The primary reference "D:\_w\1\s\Output\Release\x64\MyProject.dll" could not be resolved because it has an indirect dependency on the assembly "SharpVectors.Converters.Wpf, Version=1.8.2.0, Culture=neutral, PublicKeyToken=b532964b8548be77" which was built against the ".NETFramework,Version=v4.8" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.7.2".

2023-11-06T06:34:40.9867263Z 120>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3275: The primary reference "D:\_w\1\s\Output\Release\x64\MyProject.dll" could not be resolved because it has an indirect dependency on the assembly "SharpVectors.Model, Version=1.8.2.0, Culture=neutral, PublicKeyToken=2236cfc76b505845" which was built against the ".NETFramework,Version=v4.8" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.7.2".

2023-11-06T06:34:40.9879693Z 120>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3275: The primary reference "D:\_w\1\s\Output\Release\x64\MyProject.dll" could not be resolved because it has an indirect dependency on the assembly "SharpVectors.Core, Version=1.8.2.0, Culture=neutral, PublicKeyToken=7407205e337c98ef" which was built against the ".NETFramework,Version=v4.8" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.7.2".

2023-11-06T06:34:40.9889439Z 120>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3275: The primary reference "D:\_w\1\s\Output\Release\x64\MyProject.dll" could not be resolved because it has an indirect dependency on the assembly "SharpVectors.Css, Version=1.8.2.0, Culture=neutral, PublicKeyToken=7a46e3f532fdb787" which was built against the ".NETFramework,Version=v4.8" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.7.2".
@paulushub
Copy link
Contributor

paulushub commented Nov 6, 2023

Could the target framework be lowered to e.g. 4.7 or 4.5?

The plan is to use 4.8 for all 4.8.x builds, 4.7 for all 4.7.x builds, 4.5 for all 4.5.x builds etc. See the support below:

image

BTW, were you using SharVectors.Wpf package before 1.8.2?
If yes, which version and what was your .NET targets?

@paulushub paulushub self-assigned this Nov 6, 2023
@Metalfusion
Copy link
Author

I haven't used any older version of SharpVectors before.

So does the package already include dlls built targeting all those different 4.X frameworks?

If that is the case then guess the issue must be somewhere in my solution build and how it selects the dlls that get referenced, it is actually a quite complicated application with both old and SDK-style csprojects which depend on each other.
A strange thing is also that a local build with VS 2022 succeeds but fails on VS 2019 CI build machine.

@paulushub
Copy link
Contributor

So does the package already include dlls built targeting all those different 4.X frameworks?

Yes, the framework versions highlighted (in blue) in the above image are supported.
If you get any error with that then it is a bug that must be fixed.

@ElinamLLC ElinamLLC locked and limited conversation to collaborators Nov 7, 2023
@paulushub paulushub converted this issue into discussion #270 Nov 7, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

2 participants