Skip to content

Targeting .NET 7 instead of .NET Framework #598

Open
@bdovaz

Description

@bdovaz

If you are worried about dependencies, we can publish in portable mode: https://learn.microsoft.com/en-us/dotnet/core/deploying/#publish-self-contained

Once #595 is merge it will be much easier.

The benefits are clearly to be able to use a more updated code base, more secured, much more optimized, with more modern APIs, etc...

Activity

tom-englert

tom-englert commented on Oct 30, 2023

@tom-englert
Collaborator

How can you run a .NET 7 dll in a NetFramework executable?

bdovaz

bdovaz commented on Oct 30, 2023

@bdovaz
ContributorAuthor

@tom-englert I have not explained myself well.

I mean stop targeting .NET Framework and target .NET 7.

WPF applications do not depend on .NET Framework only, they are also compatible with .NET Core / .NET 5/6/7:

https://learn.microsoft.com/en-us/dotnet/desktop/wpf/migration/?view=netdesktop-7.0

tom-englert

tom-englert commented on Oct 31, 2023

@tom-englert
Collaborator

Visual Studio is NetFramework 462, so extensions must be the same

tom-englert

tom-englert commented on Oct 31, 2023

@tom-englert
Collaborator

So if you want to contribute something here, you could migrate to the new extensibility model, so the extension does no longer run in process with Visual Studio:

https://learn.microsoft.com/en-us/visualstudio/extensibility/visualstudio.extensibility/visualstudio-extensibility?view=vs-2022

bdovaz

bdovaz commented on Oct 31, 2023

@bdovaz
ContributorAuthor

Visual Studio is NetFramework 462, so extensions must be the same

But it can be made multi target and that if the extension (at least for the moment) has to be net framework that it is but for the rest that it can take advantage of the benefits of being in .NET 7.

bdovaz

bdovaz commented on Oct 31, 2023

@bdovaz
ContributorAuthor

So if you want to contribute something here, you could migrate to the new extensibility model, so the extension does no longer run in process with Visual Studio:

https://learn.microsoft.com/en-us/visualstudio/extensibility/visualstudio.extensibility/visualstudio-extensibility?view=vs-2022

I can look at it but as I say, so that it is not blocking you can make it multi target, you already do it in several projects.

tom-englert

tom-englert commented on Nov 5, 2023

@tom-englert
Collaborator

Multi-targeting for no need is very annoying, because constraints and warnings are often different in NetFramework vs DotNet.
So instead of benefit from DotNet 7, you have to suppress all the hints and refactorings for DotNet7 that are not possible in NetFramework.

bdovaz

bdovaz commented on Nov 5, 2023

@bdovaz
ContributorAuthor

Where necessary (in cases where there are API changes in the .NET Framework vs. .NET 7), it can be used as:

#if NET7_0_OR_GREATER
#else
#endif

So there is no need to suppress or avoid anything.

https://learn.microsoft.com/en-us/dotnet/standard/frameworks#preprocessor-symbols

tom-englert

tom-englert commented on Nov 5, 2023

@tom-englert
Collaborator

I will definitely not start to write conditional code unless there is a very strong demand to do so.
It will just make the code unmaintainable, with very low to no benefit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

      Participants

      @bdovaz@tom-englert

      Issue actions

        Targeting .NET 7 instead of .NET Framework · Issue #598 · dotnet/ResXResourceManager