-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Impossible to add UseWindowsForms in a MAUI project #14970
Comments
Hi @guyvaio. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
Most likely, your issue is already addressed in MAUI Main, Original Issue: #6450 |
Repro
|
Hi @guyvaio. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
You need to create a repro project. This helps by removing chances of ambiguity and a way for both of us to verify that the changes work. I know it seems obvious to do, but it really helps. |
Repro project attached |
Hi @guyvaio. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
I apologize; I should have specified this: Can you make this a public repo on GitHub or another source repository? |
I am not sure we support this on .NET 7. What happens if you target .NET 8? |
Hi @guyvaio. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
As mentioned in my first post : .net 7.0 |
Not solved in Visual Studio 17.9.6 |
This happens with a plain WinUI app and I think this is all because we have conflicting compilers for XAML. We have MAUI, WinUI 3 and WPF all trying to build. Adding UseWindowsForms should be OK, but then it detects XAML and goes off on a error spree. I don't think these are all meant to work together, and if they are, they were never tested as such. With MAUI and WPF/WinUI maybe we could get by as we have a MauiXaml build action, but both WPF and WinUI use Page, so this means it will never work without great effort. Please open a bug for WinUI and WPF to address. |
I've created a new MAUI project 7.0. In this project I need to reference an assembly compiled against .net 7.0 but with
<UseWindowsForms>true</UseWindowsForms>
. So I need to add<UseWindowsForms>true</UseWindowsForms>
in the project.When adding this line, the project does not compile anymore and claims for: "Project file must include the .NET Framework assembly 'PresentationCore, PresentationFramework' in the reference list. ... Microsoft.WinFX.targets".
I understand I have to add this line in the MAUI project (not needed in my case):
<UseWPF>true</UseWPF>
.Consequently I get this error: 'App' does not contain a definition for 'InitializeComponent'
Tried to force build action to MauiXaml for all XAML files.
if I replace all XAM file by their equivalent cs files, I can add
UseWindowsForms
withoutUseWpf
and everything works fine.Seems that when
UseWindowsForms
is added and XAML files exist, WPF is required, even though there is no XAML files for WPF.Visual Studio 17.5.5 has been restarted several times. Bin and Obj directories have been manually deleted several times.
The text was updated successfully, but these errors were encountered: