Open UseMuse opened 3 years ago
the same if you add EntityFramework (not core)
Did you check in the settings step of the publish wizard.
If the *.dll is marked as "Include" in the "Application Files"?
Your minimal repo "WpfApp1.zip" doesn't seem to have a reference to "Microsoft.EntityFrameworkCore.SqlServer" the *.csproj file looks like this:
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWPF>true</UseWPF>
</PropertyGroup>
</Project>
As a side note, your publish profile contains <SelfContained>False</SelfContained>
so your publish would rely that the .net core 3.1 or .net 5 runtime to be installed on the machine you want to install the application.
Maybe this is helpful https://docs.microsoft.com/en-us/dotnet/core/deploying/
Check the difference of deployment of "framework-dependent" and "self-contained".
@Rand-Random create a new project, add Microsoft.EntityFrameworkCore.SqlServer, publish and your project won't open
.NET Core Version: netcoreapp3.1 or net5.0-windows
Windows version: ajor 10 Minor 0 Build 19042 Revision 0
Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc...)? No
Problem description:
Create a new WPF application with TargetFramework netcoreapp3.1 or net5.0-windows, it doesn't matter.
All right
I add to the application via NuGet Microsoft.EntityFrameworkCore.SqlServer 5.0.1
I run it locally - everything works
I publish!
I launch the application from the shortcut, it is updated, but no longer opens!
The problem is solved by manually copying the runtimes folder, this does not suit me
The application worked fine until I added Microsoft.EntityFrameworkCore.SqlServer 5.0.1 and republished
Actual behavior:
I caught the error text:
Description: A .NET Core application failed. Application: WpfApp1.exe Path: C: \ Users \ .... \ AppData \ Local \ Apps \ 2.0 \ GKP1YVXQ.DT4 \ QT7Y2ENE.D3P \ test..tion_0000000000000000_0001.0000_d72842864688dda2 \ WpfApp1.exe Message: Error: An assembly specified in the application dependencies manifest (WpfApp1.deps.json) was not found: package: 'Microsoft.Data.SqlClient', version: '2.0.1' path: 'runtimes/win/lib/netcoreapp3.1/Microsoft.Data.SqlClient.dll'
Expected behavior:
I want the application after adding Microsoft.EntityFrameworkCore.SqlServer 5.0.1 and publications were updated and launched
Minimal repro:
WpfApp1.zip