Skip to content

[Question] Referencing .NET Framework WinForms from .NET Core WinForms #10438

@janseris

Description

@janseris

.NET version

8.0.1

Did it work in .NET Framework?

Not tested/verified

Did it work in any of the earlier releases of .NET Core or .NET 5+?

No response

Issue description

How is WinForms NET Core -> NET Framework intended to work?
I noticed that when I create old csproj style WinForms, Visual Studio does not report any warnings
When I switch to new csproj and change target framework moniker to .NET Framework 4.8, I start receiving warning which afaik cannot be disabled.
Using new csproj structure allows me to use Sync Namespaces feature in Visual Studio which is very important in large projects.


Severity	Code	Description	Project	File	Line	Suppression State
Warning	NU1702	ProjectReference 'C:\Users\Jan\Desktop\prace\WinFormsCsProjNewOldTest\WinFormsNetFrameworkClassLibraryNewProjectStructure\WinFormsNetFrameworkClassLibraryNewProjectStructure.csproj' was resolved using '.NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v8.0'. This project may not be fully compatible with your project.	WinFormsNetCore	C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets	1860	

Why is that? Is it supposed to be there?

obrazek

Steps to reproduce

https://github.com/janseris/WinFormsCsProjNewOldTest

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

    Issue actions