3
  1. Installed Visual Studio 2022 (on a clean/fresh Windows 11 installation), installed Template Studio for WinUI (v5.3).
  2. Created a Project using Template Studio with these Settings:
- Project type:         Navigation pane
- Design pattern:       MVVM Toolkit
- Pages (Blank pages):
    * Page1
    * Page2
    *
    *
    * Settings page
- Features:
    * Settings Storage  added
    * MSIX Packaging    added
    * Self-Contained    added
    * App Notifications added
    * Theme Selection   added
- Testing: MSTest       not added
  1. Installed Microsoft.EntityFrameworkCore.SqlServer (to connect to my SQL Server).

  2. After installing Microsoft.EntityFrameworkCore.SqlServer (Latest stable 7.0.4) and immediately after that trying to run an App I get the following error:

Found multiple publish output files with the same relative path:
D:\07_PROJECTS\Kratos365\Kratos365\obj\x64\Debug\net7.0-windows10.0.19041.0\win10-x64\MsixContent\Microsoft.Web.WebView2.Core.dll,
C:\Users\mladen\.nuget\packages\microsoft.web.webview2\1.0.864.35\lib\netcoreapp3.0\Microsoft.Web.WebView2.Core.dll
Kratos365 C:\Program Files\dotnet\sdk\7.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets   112

I did noticed whilst installing Microsoft.EntityFrameworkCore.SqlServer that Microsoft.Web.WebView2 (version 1.0.864.35) got installed as well as seen in this screenshot:

Screenshot

But I'm guessing (from the Error) that there is another version of Microsoft.Web.WebView2 in MSIX Packaging in the Project folder.

What I tried:

  1. I tried adding the following propertyto my .csproj files, as suggested in this answer here
<PropertyGroup>
 <ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
</PropertyGroup>

But that gave me following error:

Payload contains two or more files with the same destination path 'Microsoft.Web.WebView2.Core.dll'. Source files:
D:\07_PROJECTS\Kratos365\Kratos365\obj\x64\Debug\net7.0-windows10.0.19041.0\win10-x64\MsixContent\Microsoft.Web.WebView2.Core.dll
C:\Users\mladen\.nuget\packages\microsoft.web.webview2\1.0.864.35\lib\netcoreapp3.0\Microsoft.Web.WebView2.Core.dll
Kratos365 C:\Users\mladen\.nuget\packages\microsoft.windowsappsdk\1.2.230313.1\buildTransitive\Microsoft.Build.Msix.Packaging.targets   1504    

  1. I tried deleting the 'bin' and 'obj' folders from the Project folder and rebuilding solution but that gave me a bunch of other errors.

  2. I tried uninstalling (Start menu > right click on it, uninstall), and then cleaning the solution in Visual Studio before trying to deploy it again, as suggested in this answer here

At this point I tried everything and anything that I could find online - posting a question here is my last resort

Could this be some weird Template Studio for WinUI / Microsoft.EntityFrameworkCore.SqlServer conflict?

  • Deleting the Bin and OBJ was the correct way of starting. You need to find out why the other errors are occurring. Most likely one of your references is missing or not valid. The usual solution is to go to Solution Explorer in VS and Add/Delete reference that are giving errors. You also may need to change the "Using" statements at top of module. – jdweng Apr 08 '23 at 14:44
  • Having the same issue with Azure.Storage.Blobs, nothing but headaches with WinUI3 so far, not impressed with the out-of-the-box experience. – Matt F Apr 11 '23 at 23:48

1 Answers1

3

In the end the solution was to downgrade Microsoft.EntityFrameworkCore.SqlServer NuGet Package from the Latest stable 7.0.4 down to 6.0.15.

Any version above 6.0.15 (7.0.0; 7.0.1; 7.0.2; 7.0.3; 7.0.4) that contained Microsoft.Web.WebView2 would spit out the Error Found multiple publish output files with the same relative path

I think it was some sort of Microsoft.Web.WebView2 version conflict from MSIX Packaging within Template Studio for WinUI and Microsoft.EntityFrameworkCore.SqlServer NuGet package.