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

Can't Use In WinUi 3 #2270

Closed
aliajboy opened this issue Dec 14, 2023 · 12 comments
Closed

Can't Use In WinUi 3 #2270

aliajboy opened this issue Dec 14, 2023 · 12 comments
Labels
🔗 External Issue is in an external component

Comments

@aliajboy
Copy link

Describe the bug

I was Stuck with an error of "found multiple publish output files" and after about 2 hours I found out that this nuget package has something wrong with it in WinUi 3. I tested "System.Data.SqlClient" and It worked Fine. but "Microsoft.Data.SqlClient" won't work. Both of them are at latest versions.
I tested everything and found that this particular nuget package is the source of my problems in WinUI 3. It works on anything else for example ASP.Net Core, Blazor, WPF, WinForm etc.
I didn't test it in MAUI.

To reproduce

It's Simple. Just make a WinUi 3 App with "Template Studio For WinUI 3" and add this nuget package. try to open the app.

Further technical details

Microsoft.Data.SqlClient version: 5.1.2
.NET target: .Net 7
SQL Server version: SQL Server 2022
Operating system: Latest Windows 11
Latest Visual Studio as of today

@David-Engel David-Engel added the 🆕 Triage Needed For new issues, not triaged yet. label Dec 15, 2023
@Wraith2
Copy link
Contributor

Wraith2 commented Dec 16, 2023

I just created a new with the blank template. Added two textblocks and printed the assembly version to one and the output of SELECT @@version to the other:

image

Works for me. You'll need to provide a reproduction.

@aliajboy
Copy link
Author

aliajboy commented Dec 17, 2023

You didn't read carefully. I said create with in "Template studio For Winui". not only blank template of VS.
https://github.com/microsoft/TemplateStudio

@Wraith2
Copy link
Contributor

Wraith2 commented Dec 17, 2023

I installed that extension and used the bank template that it provides in a new project. As you said.
If you want someone to look into it they need to be able to reproduce it. I suggest you upload the entire project as a zip or put it on github.

@aliajboy
Copy link
Author

aliajboy commented Dec 18, 2023

Note 1: I found that if you use this extension and select blank in project type, you don't have error.
Note 2: I found that if you select navigation on project type and select all the other step as is, you don't have error.
I found exactly what makes this error.

To Reproduce, Use these Steps EXACTLY:

1- Use Template studio for WinUi
1

2- select navigation in project type

3- select Next Until step 4

4- select self-contained (This one is the Problem, I tested different type on selecting in template studio wizard)
2

add Microsoft.Data.SqlClient to the Core project.

Here is a video if you can't reproduce:

Rec.0002.mp4

It Doesn't matter if you select x86-x64-packaged or un-packaged, the same error will happen if you try to run the app. The same is happening when you add this package to Main project.
If you can't reproduce with these steps, I will share the project. But I am sure it will happen at your pc too. I tested this on 2 computers with windows 10 and 11. all the same error.
Thank you!

@aliajboy
Copy link
Author

aliajboy commented Dec 19, 2023

nobody responds?
my friend @Wraith2 ? did you reproduce with my step by step answer?

@Wraith2
Copy link
Contributor

Wraith2 commented Dec 19, 2023

I'll come back to you when i've had chance to look.
I suspect it's a packaging issue either with the runtime (unlikely) or something in the template toolkit.

@aureole82
Copy link

This is a duplicate of microsoft/microsoft-ui-xaml#5689

@kf-gonzalez2
Copy link

@aliajboy can you try the workaround suggested in the microsoft/microsoft-ui-xaml#5689 thread and comment if this is a potential related issue?

@aliajboy
Copy link
Author

@kf-gonzalez2 I tried the workaround, It didn't fix this issue.

@DmitriyKomin
Copy link

@aliajboy, from the error shown in your video above, you are hitting microsoft/microsoft-ui-xaml#5689. That issue has been fixed in WinAppSDK 1.6 Experimental 2, released yesterday - please give this a try, I expect it will resolve your issue.

More context: Microsoft.Data.SqlClient references Microsoft.Identity.Client (>= 4.60.3), which references Microsoft.Web.WebView2 (>= 1.0.864.35). This leads to Issue 5689 since there are multiple definitions of Microsoft.Web.WebView2 types - one embedded into WinAppSDK, the other a transitive reference to standalone Microsoft.Web.WebView2 package. (In 1.6 Expereimental 2, we refactored WinAppSDK to consume Microsoft.Web.WebView2 as a nuget reference and got rid of the embedding.)

@kf-gonzalez2 kf-gonzalez2 added the ⏳ Waiting for Customer Issues/PRs waiting for user response/action. label Jul 9, 2024
@aliajboy
Copy link
Author

@DmitriyKomin I tried to install and work with v1.6 exp 2 but couldn't find out how to install and use. I will wait for stable release, or you can try it yourself and share the video (if it's fixed).
after I upgrade my winappsdk to 1.6 exp 2, I get an error. something about minimum target is 10.0.19041.35-preview. I change it and work on it for about 2 hours, but nothing helped. so, I get tired and w8 for stable. tnx

@kf-gonzalez2
Copy link

Closing as it is an external issue

@DavoudEshtehari DavoudEshtehari added 🔗 External Issue is in an external component and removed ⏳ Waiting for Customer Issues/PRs waiting for user response/action. labels Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔗 External Issue is in an external component
Projects
Development

No branches or pull requests

8 participants