.Net Upgradation

Naman Jain 1 Reputation point
2022-10-12T12:49:24.41+00:00

Hi Team

I just wanna know can lower .NET version application take ref of higher .NET version application ?

ex: I have an application which is on .NET version 4.6.1 and in that I just wanna take ref of .NET version 4.7.2 application so is that possible because when I am trying to build the application getting so many errors.

Can you please provide any doc link also related to this ?

Developer technologies Windows Presentation Foundation
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Hui Liu-MSFT 48,676 Reputation points Microsoft External Staff
    2022-10-13T08:48:14.353+00:00

    Hi,@Naman Jain . Welcome Microsoft Q&A.

    You could use a .Net Framework 4.6.1 assembly (lower version) in a .Net Framework 4.7.2 project (higher version), but not the other way around.

    If you reference a higher version assembly in a lower version project, there will be the following warning after building.

    Warning: The primary reference " " could not be resolved because it was built against the ".NETFramework,Version=v4.7.2" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.6.1"

    I think the build stops working when actually using something from .NETFramework 4.7.2 .

    Generally, the libraries target a version that is lower than or equal to the version your project (It is best to target the same Target framework).
    Note, of course, that any behavior changes could cause subtle bugs, but this is rare - fundamentally it should work ok.

    You can refer to the link below.
    https://stackoverflow.com/questions/2761640/making-a-call-to-a-net-4-library-from-3-5
    https://stackoverflow.com/questions/18530915/can-my-project-reference-an-assembly-targeting-a-lower-version-of-net-framework

    ----------------------------------------------------------------------------

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.