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

Make the DemoConsole application multi-targeted to both .NET and .NET Framework #12830

Open
Olina-Zhang opened this issue Jan 23, 2025 · 3 comments · May be fixed by #12885
Open

Make the DemoConsole application multi-targeted to both .NET and .NET Framework #12830

Olina-Zhang opened this issue Jan 23, 2025 · 3 comments · May be fixed by #12885
Assignees
Labels
🚧 work in progress Work that is current in progress test-enhancement Improvements of test source code
Milestone

Comments

@Olina-Zhang
Copy link
Member

Olina-Zhang commented Jan 23, 2025

.NET version

10.0.100-alpha.1.25072.10

Did it work in .NET Framework?

Not tested/verified

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

Not an issue, need to modify DemoConsole application with multi-targeted

Issue description

Make the DemoConsole application in Winforms repo multi-targeted to both .NET and .NET Framework so that we can validate where we've got regressions from NetFX

@Olina-Zhang Olina-Zhang added untriaged The team needs to look at this issue in the next triage test-enhancement Improvements of test source code labels Jan 23, 2025
@Tanya-Solyanik Tanya-Solyanik removed the untriaged The team needs to look at this issue in the next triage label Jan 23, 2025
@Tanya-Solyanik Tanya-Solyanik added this to the .NET 10.0 milestone Jan 23, 2025
@ricardobossan ricardobossan linked a pull request Feb 6, 2025 that will close this issue
@dotnet-policy-service dotnet-policy-service bot added the 🚧 work in progress Work that is current in progress label Feb 6, 2025
@ricardobossan
Copy link
Member

@Tanya-Solyanik @LeafShi1 @Epica3055

I created PR #12885 to show my current approach for making DemoConsole multi-targeted.

However, the build fails with the following errors:

PS C:\Users\v-rbossan\winforms> .\Restore.cmd;.\build.cmd
Variable NativeToolsOnMachine detected, enabling native tool path promotion...
Processing C:\Users\v-rbossan\winforms\global.json
  C:\.tools\.nuget\packages\microsoft.dotnet.arcade.sdk\10.0.0-beta.25074.4\tools\Tools.proj             Restore (0.7s)
  Runtime toolset 'dotnet/x64 v10.0.0-preview.2.25104.8' already installed.                                      (1.3s)
Restauração concluída (1.3s)
  Winforms falhou com 4 erro(s) (0.4s)
    C:\Users\v-rbossan\winforms\src\System.Windows.Forms\tests\IntegrationTests\DesignSurface\DesignSurfaceExt\DesignSurfaceExt.csproj : error NU1201: O projeto System.Design não é compatível com net462 (.NETFramework,Version=v4.6.2). O projeto System.Design dá suporte a: net10.0 (.NETCoreApp,Version=v10.0)
    C:\Users\v-rbossan\winforms\src\System.Windows.Forms\tests\IntegrationTests\DesignSurface\DesignSurfaceExt\DesignSurfaceExt.csproj : error NU1201: O projeto System.Drawing.Design não é compatível com net462 (.NETFramework,Version=v4.6.2). O projeto System.Drawing.Design dá suporte a: net10.0 (.NETCoreApp,Version=v10.0)
    C:\Users\v-rbossan\winforms\src\System.Windows.Forms\tests\IntegrationTests\DesignSurface\DesignSurfaceExt\DesignSurfaceExt.csproj : error NU1201: O projeto System.Windows.Forms.Design não é compatível com net462 (.NETFramework,Version=v4.6.2). O projeto System.Windows.Forms.Design dá suporte a: net10.0 (.NETCoreApp,Version=v10.0)
    C:\Users\v-rbossan\winforms\src\System.Windows.Forms\tests\IntegrationTests\DesignSurface\DesignSurfaceExt\DesignSurfaceExt.csproj : error NU1201: O projeto System.Windows.Forms não é compatível com net462 (.NETFramework,Version=v4.6.2). O projeto System.Windows.Forms dá suporte a: net10.0 (.NETCoreApp,Version=v10.0)

Construir falhou com 4 erro(s) em 3.7s
Build failed with exit code 1. Check errors above.
Variable NativeToolsOnMachine detected, enabling native tool path promotion...
Processing C:\Users\v-rbossan\winforms\global.json
  C:\.tools\.nuget\packages\microsoft.dotnet.arcade.sdk\10.0.0-beta.25074.4\tools\Tools.proj             Restore (0.7s)
  Runtime toolset 'dotnet/x64 v10.0.0-preview.2.25104.8' already installed.                                      (1.3s)
Restauração concluída (1.3s)
  Winforms falhou com 4 erro(s) (0.2s)
    C:\Users\v-rbossan\winforms\src\System.Windows.Forms\tests\IntegrationTests\DesignSurface\DesignSurfaceExt\DesignSurfaceExt.csproj : error NU1201: O projeto System.Design não é compatível com net462 (.NETFramework,Version=v4.6.2). O projeto System.Design dá suporte a: net10.0 (.NETCoreApp,Version=v10.0)
    C:\Users\v-rbossan\winforms\src\System.Windows.Forms\tests\IntegrationTests\DesignSurface\DesignSurfaceExt\DesignSurfaceExt.csproj : error NU1201: O projeto System.Drawing.Design não é compatível com net462 (.NETFramework,Version=v4.6.2). O projeto System.Drawing.Design dá suporte a: net10.0 (.NETCoreApp,Version=v10.0)
    C:\Users\v-rbossan\winforms\src\System.Windows.Forms\tests\IntegrationTests\DesignSurface\DesignSurfaceExt\DesignSurfaceExt.csproj : error NU1201: O projeto System.Windows.Forms.Design não é compatível com net462 (.NETFramework,Version=v4.6.2). O projeto System.Windows.Forms.Design dá suporte a: net10.0 (.NETCoreApp,Version=v10.0)
    C:\Users\v-rbossan\winforms\src\System.Windows.Forms\tests\IntegrationTests\DesignSurface\DesignSurfaceExt\DesignSurfaceExt.csproj : error NU1201: O projeto System.Windows.Forms não é compatível com net462 (.NETFramework,Version=v4.6.2). O projeto System.Windows.Forms dá suporte a: net10.0 (.NETCoreApp,Version=v10.0)

Construir falhou com 4 erro(s) em 4.8s
Build failed with exit code 1. Check errors above.

It looks like some dependencies aren't resolving correctly for net462. I’ve checked previous PRs related to multi-targeting but haven’t found a clear solution.

Is there an existing approach for handling this, or should we explore alternative strategies?

@Tanya-Solyanik
Copy link
Member

It does not have to be net462, it could be 4.8.1 to test against the latest. Does the version make a difference?

@LeafShi1
Copy link
Member

LeafShi1 commented Feb 6, 2025

It does not have to be net462, it could be 4.8.1 to test against the latest. Does the version make a difference?

Using net481 will also fail to build, because other projects referenced in project Demo are based on net10, such as System.Windows.Forms.Design.csproj.

If it is not referenced when TargetFramework=net481, Error1 will appear, and if it is referenced, Error2 will appear
Error1:
Image
Error2:
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚧 work in progress Work that is current in progress test-enhancement Improvements of test source code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants