title: Microsoft installer project bug
body: <p>In my WPF .NET Core app I added an installer project. Once generated and installed, when I tried to run the application I got an error </p>
  
  <blockquote>
    <p>microsoft.data.sqlclient is not supported on this platform</p>
  </blockquote>
  
  <p>I found out that if I take files <code>Project.runtimeconfig.dev.json</code> and <code>Project.deps.json</code> from a different build directory and put them into installed folder the app starts working again.</p>
  
  <p>Can somebody explain why this happens? I thought installer project just takes the entire output and packages it nicely, but there are multiple files that are found in normal build that do not carry over to installer.</p>
  
  <p>I know this is not a lot of information but I do not know what else to add so I will edit them in here upon request. I have already tried using the new packaging system, but that was an even greater failure.</p>
  
  <p>Extra info:</p>
  
  <ul>
  <li>App uses .NET Core 3.1</li>
  <li>Entity Framework Core 3.1.3 (this is where the Microsoft.data.sqlclient dependency comes from)</li>
  </ul>
  
  <p>Solution is composed of 4 projects:</p>
  
  <ul>
  <li>Project</li>
  <li>Project.Core (.netstandard 2.0)</li>
  <li>DbProject</li>
  <li>InstallerProject</li>
  </ul>
  
  <p>A part of installer build output:</p>
  
  <pre><code>3&gt;Build succeeded.
  3&gt;    0 Warning(s)
  3&gt;    0 Error(s)
  3&gt;
  3&gt;Time Elapsed 00:00:04.42
  ------ Starting pre-build validation for project 'SetupProject' ------ 
  ------ Starting pre-build validation for project 'SetupProject' ------ 
  ------ Starting pre-build validation for project 'SetupProject' ------ 
  ------ Starting pre-build validation for project 'SetupProject' ------ 
  ------ Pre-build validation for project 'SetupProject' completed ------
  ------ Pre-build validation for project 'SetupProject' completed ------
  ------ Pre-build validation for project 'SetupProject' completed ------
  ------ Pre-build validation for project 'SetupProject' completed ------
  4&gt;------ Rebuild All started: Project: SetupProject, Configuration: Debug ------
  4&gt;------ Rebuild All started: Project: SetupProject, Configuration: Debug ------
  4&gt;------ Rebuild All started: Project: SetupProject, Configuration: Debug ------
  Building file 'D:\User_files\Projekty\C#\Archivator_desktop_WPF_WTS\SetupProject\Debug\SetupProject.msi'...
  Building file 'D:\User_files\Projekty\C#\Archivator_desktop_WPF_WTS\SetupProject\Debug\SetupProject.msi'...
  Building file 'D:\User_files\Projekty\C#\Archivator_desktop_WPF_WTS\SetupProject\Debug\SetupProject.msi'...
  Building file 'D:\User_files\Projekty\C#\Archivator_desktop_WPF_WTS\SetupProject\Debug\SetupProject.msi'...
  WARNING: File 'sni.dll' of project output 'Publish Items from Archivator_desktop_WPF_WTS (Debug x64)' targeting 'Unknown' is not compatible with the project's target platform 'x64'
  WARNING: File 'sni.dll' of project output 'Publish Items from Archivator_desktop_WPF_WTS (Debug x64)' targeting 'Unknown' is not compatible with the project's target platform 'x64'
  WARNING: File 'sni.dll' of project output 'Publish Items from Archivator_desktop_WPF_WTS (Debug x64)' targeting 'Unknown' is not compatible with the project's target platform 'x64'
  WARNING: File 'sni.dll' of project output 'Publish Items from Archivator_desktop_WPF_WTS (Debug x64)' targeting 'Unknown' is not compatible with the project's target platform 'x64'
  Packaging file 'appsettings.json'...
  Packaging file 'appsettings.json'...
  Packaging file 'appsettings.json'...
  Packaging file 'appsettings.json'...
  Packaging file 'Microsoft.EntityFrameworkCore.Proxies.dll'...
  Packaging file 'Microsoft.EntityFrameworkCore.Proxies.dll'...
  Packaging file 'Microsoft.EntityFrameworkCore.Proxies.dll'...
  Packaging file 'Microsoft.EntityFrameworkCore.Proxies.dll'...
  Packaging file 'Microsoft.Bcl.HashCode.dll'...
  Packaging file 'Microsoft.Bcl.HashCode.dll'...
  Packaging file 'Microsoft.Bcl.HashCode.dll'...
  Packaging file 'Microsoft.Bcl.HashCode.dll'...
  Packaging file 'sni.dll'...
  Packaging file 'sni.dll'...
  Packaging file 'sni.dll'...
  Packaging file 'sni.dll'...
  Packaging file 'MahApps.Metro.dll'...
  Packaging file 'MahApps.Metro.dll'...
  Packaging file 'MahApps.Metro.dll'...
  Packaging file 'MahApps.Metro.dll'...
  Packaging file 'Archivator_desktop_WPF_WTS.Core.dll'...
  Packaging file 'Archivator_desktop_WPF_WTS.Core.dll'...
  Packaging file 'Archivator_desktop_WPF_WTS.Core.dll'...
  Packaging file 'Archivator_desktop_WPF_WTS.Core.dll'...
  Packaging file 'Microsoft.Extensions.Hosting.dll'...
  Packaging file 'Microsoft.Extensions.Hosting.dll'...
  Packaging file 'Microsoft.Extensions.Hosting.dll'...
  Packaging file 'Microsoft.Extensions.Hosting.dll'...
  Packaging file 'Microsoft.Extensions.Primitives.dll'...
  Packaging file 'Microsoft.Extensions.Primitives.dll'...
  Packaging file 'Microsoft.Extensions.Primitives.dll'...
  Packaging file 'Microsoft.Extensions.Primitives.dll'...
  Packaging file 'System.Runtime.Caching.dll'...
  Packaging file 'System.Runtime.Caching.dll'...
  Packaging file 'System.Runtime.Caching.dll'...
  Packaging file 'System.Runtime.Caching.dll'...
  Packaging file 'Microsoft.EntityFrameworkCore.Relational.dll'...
  Packaging file 'Microsoft.EntityFrameworkCore.Relational.dll'...
  Packaging file 'Microsoft.EntityFrameworkCore.Relational.dll'...
  Packaging file 'Microsoft.EntityFrameworkCore.Relational.dll'...
  Packaging file 'Microsoft.Extensions.FileSystemGlobbing.dll'...
  Packaging file 'Microsoft.Extensions.FileSystemGlobbing.dll'...
  Packaging file 'Microsoft.Extensions.FileSystemGlobbing.dll'...
  Packaging file 'Microsoft.Extensions.FileSystemGlobbing.dll'...
  Packaging file 'Microsoft.Extensions.DependencyInjection.dll'...
  Packaging file 'Microsoft.Extensions.DependencyInjection.dll'...
  Packaging file 'Microsoft.Extensions.DependencyInjection.dll'...
  Packaging file 'Microsoft.Extensions.DependencyInjection.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.Abstractions.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.Abstractions.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.Abstractions.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.Abstractions.dll'...
  Packaging file 'Microsoft.Identity.Client.dll'...
  Packaging file 'Microsoft.Identity.Client.dll'...
  Packaging file 'Microsoft.Identity.Client.dll'...
  Packaging file 'Microsoft.Identity.Client.dll'...
  Packaging file 'Microsoft.EntityFrameworkCore.SqlServer.dll'...
  Packaging file 'Microsoft.EntityFrameworkCore.SqlServer.dll'...
  Packaging file 'Microsoft.EntityFrameworkCore.SqlServer.dll'...
  Packaging file 'Microsoft.EntityFrameworkCore.SqlServer.dll'...
  Packaging file 'Microsoft.Extensions.Logging.Abstractions.dll'...
  Packaging file 'Microsoft.Extensions.Logging.Abstractions.dll'...
  Packaging file 'Microsoft.Extensions.Logging.Abstractions.dll'...
  Packaging file 'Microsoft.Extensions.Logging.Abstractions.dll'...
  Packaging file 'Microsoft.Extensions.DependencyInjection.Abstractions.dll'...
  Packaging file 'Microsoft.Extensions.DependencyInjection.Abstractions.dll'...
  Packaging file 'Microsoft.Extensions.DependencyInjection.Abstractions.dll'...
  Packaging file 'Microsoft.Extensions.DependencyInjection.Abstractions.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.UserSecrets.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.UserSecrets.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.UserSecrets.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.UserSecrets.dll'...
  Packaging file 'Microsoft.Extensions.Logging.Console.dll'...
  Packaging file 'Microsoft.Extensions.Logging.Console.dll'...
  Packaging file 'Microsoft.Extensions.Logging.Console.dll'...
  Packaging file 'Microsoft.Extensions.Logging.Console.dll'...
  Packaging file 'ControlzEx.dll'...
  Packaging file 'ControlzEx.dll'...
  Packaging file 'ControlzEx.dll'...
  Packaging file 'ControlzEx.dll'...
  Packaging file 'Microsoft.Extensions.Hosting.Abstractions.dll'...
  Packaging file 'Microsoft.Extensions.Hosting.Abstractions.dll'...
  Packaging file 'Microsoft.Extensions.Hosting.Abstractions.dll'...
  Packaging file 'Microsoft.Extensions.Hosting.Abstractions.dll'...
  Packaging file 'Castle.Core.dll'...
  Packaging file 'Castle.Core.dll'...
  Packaging file 'Castle.Core.dll'...
  Packaging file 'Castle.Core.dll'...
  Packaging file 'Microsoft.EntityFrameworkCore.dll'...
  Packaging file 'Microsoft.EntityFrameworkCore.dll'...
  Packaging file 'Microsoft.EntityFrameworkCore.dll'...
  Packaging file 'Microsoft.EntityFrameworkCore.dll'...
  Packaging file 'System.Runtime.Caching.dll'...
  Packaging file 'System.Runtime.Caching.dll'...
  Packaging file 'System.Runtime.Caching.dll'...
  Packaging file 'System.Runtime.Caching.dll'...
  Packaging file 'Archivator_desktop_WPF_WTS.runtimeconfig.json'...
  Packaging file 'Archivator_desktop_WPF_WTS.runtimeconfig.json'...
  Packaging file 'Archivator_desktop_WPF_WTS.runtimeconfig.json'...
  Packaging file 'Archivator_desktop_WPF_WTS.runtimeconfig.json'...
  Packaging file 'sni.dll'...
  Packaging file 'sni.dll'...
  Packaging file 'sni.dll'...
  Packaging file 'sni.dll'...
  Packaging file 'Microsoft.Extensions.Caching.Abstractions.dll'...
  Packaging file 'Microsoft.Extensions.Caching.Abstractions.dll'...
  Packaging file 'Microsoft.Extensions.Caching.Abstractions.dll'...
  Packaging file 'Microsoft.Extensions.Caching.Abstractions.dll'...
  Packaging file 'Archivator_desktop_WPF_WTS.exe'...
  Packaging file 'Archivator_desktop_WPF_WTS.exe'...
  Packaging file 'Archivator_desktop_WPF_WTS.exe'...
  Packaging file 'Archivator_desktop_WPF_WTS.exe'...
  Packaging file 'Newtonsoft.Json.dll'...
  Packaging file 'Newtonsoft.Json.dll'...
  Packaging file 'Newtonsoft.Json.dll'...
  Packaging file 'Newtonsoft.Json.dll'...
  Packaging file 'Microsoft.Extensions.Logging.dll'...
  Packaging file 'Microsoft.Extensions.Logging.dll'...
  Packaging file 'Microsoft.Extensions.Logging.dll'...
  Packaging file 'Microsoft.Extensions.Logging.dll'...
  Packaging file 'Microsoft.Extensions.Logging.Debug.dll'...
  Packaging file 'Microsoft.Extensions.Logging.Debug.dll'...
  Packaging file 'Microsoft.Extensions.Logging.Debug.dll'...
  Packaging file 'Microsoft.Extensions.Logging.Debug.dll'...
  Packaging file 'Microsoft.Extensions.Caching.Memory.dll'...
  Packaging file 'Microsoft.Extensions.Caching.Memory.dll'...
  Packaging file 'Microsoft.Extensions.Caching.Memory.dll'...
  Packaging file 'Microsoft.Extensions.Caching.Memory.dll'...
  Packaging file 'Microsoft.Extensions.Options.ConfigurationExtensions.dll'...
  Packaging file 'Microsoft.Extensions.Options.ConfigurationExtensions.dll'...
  Packaging file 'Microsoft.Extensions.Options.ConfigurationExtensions.dll'...
  Packaging file 'Microsoft.Extensions.Options.ConfigurationExtensions.dll'...
  Packaging file 'Microsoft.Extensions.FileProviders.Physical.dll'...
  Packaging file 'Microsoft.Extensions.FileProviders.Physical.dll'...
  Packaging file 'Microsoft.Extensions.FileProviders.Physical.dll'...
  Packaging file 'Microsoft.Extensions.FileProviders.Physical.dll'...
  Packaging file 'Microsoft.EntityFrameworkCore.Abstractions.dll'...
  Packaging file 'Microsoft.EntityFrameworkCore.Abstractions.dll'...
  Packaging file 'Microsoft.EntityFrameworkCore.Abstractions.dll'...
  Packaging file 'Microsoft.EntityFrameworkCore.Abstractions.dll'...
  Packaging file 'Archivator_desktop_WPF_WTS.dll'...
  Packaging file 'Archivator_desktop_WPF_WTS.dll'...
  Packaging file 'Archivator_desktop_WPF_WTS.dll'...
  Packaging file 'Archivator_desktop_WPF_WTS.dll'...
  Packaging file 'System.Runtime.Caching.dll'...
  Packaging file 'System.Runtime.Caching.dll'...
  Packaging file 'System.Runtime.Caching.dll'...
  Packaging file 'System.Runtime.Caching.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.Binder.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.Binder.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.Binder.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.Binder.dll'...
  Packaging file 'Microsoft.Extensions.Logging.EventSource.dll'...
  Packaging file 'Microsoft.Extensions.Logging.EventSource.dll'...
  Packaging file 'Microsoft.Extensions.Logging.EventSource.dll'...
  Packaging file 'Microsoft.Extensions.Logging.EventSource.dll'...
  Packaging file 'Microsoft.Extensions.Logging.Configuration.dll'...
  Packaging file 'Microsoft.Extensions.Logging.Configuration.dll'...
  Packaging file 'Microsoft.Extensions.Logging.Configuration.dll'...
  Packaging file 'Microsoft.Extensions.Logging.Configuration.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.FileExtensions.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.FileExtensions.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.FileExtensions.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.FileExtensions.dll'...
  Packaging file 'sni.dll'...
  Packaging file 'sni.dll'...
  Packaging file 'sni.dll'...
  Packaging file 'sni.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.EnvironmentVariables.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.EnvironmentVariables.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.EnvironmentVariables.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.EnvironmentVariables.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.CommandLine.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.CommandLine.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.CommandLine.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.CommandLine.dll'...
  Packaging file 'Microsoft.Data.SqlClient.dll'...
  Packaging file 'Microsoft.Data.SqlClient.dll'...
  Packaging file 'Microsoft.Data.SqlClient.dll'...
  Packaging file 'Microsoft.Data.SqlClient.dll'...
  Packaging file 'Microsoft.Data.SqlClient.dll'...
  Packaging file 'Microsoft.Data.SqlClient.dll'...
  Packaging file 'Microsoft.Data.SqlClient.dll'...
  Packaging file 'Microsoft.Data.SqlClient.dll'...
  Packaging file 'Microsoft.Extensions.FileProviders.Abstractions.dll'...
  Packaging file 'Microsoft.Extensions.FileProviders.Abstractions.dll'...
  Packaging file 'Microsoft.Extensions.FileProviders.Abstractions.dll'...
  Packaging file 'Microsoft.Extensions.FileProviders.Abstractions.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.Json.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.Json.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.Json.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.Json.dll'...
  Packaging file 'Microsoft.Extensions.Logging.EventLog.dll'...
  Packaging file 'Microsoft.Extensions.Logging.EventLog.dll'...
  Packaging file 'Microsoft.Extensions.Logging.EventLog.dll'...
  Packaging file 'Microsoft.Extensions.Logging.EventLog.dll'...
  Packaging file 'Microsoft.Data.SqlClient.dll'...
  Packaging file 'Microsoft.Data.SqlClient.dll'...
  Packaging file 'Microsoft.Data.SqlClient.dll'...
  Packaging file 'Microsoft.Data.SqlClient.dll'...
  Packaging file 'Microsoft.Extensions.Options.dll'...
  Packaging file 'Microsoft.Extensions.Options.dll'...
  Packaging file 'Microsoft.Extensions.Options.dll'...
  Packaging file 'Microsoft.Extensions.Options.dll'...
  Packaging file 'Microsoft.Xaml.Behaviors.dll'...
  Packaging file 'Microsoft.Xaml.Behaviors.dll'...
  Packaging file 'Microsoft.Xaml.Behaviors.dll'...
  Packaging file 'Microsoft.Xaml.Behaviors.dll'...
  Packaging file 'Microsoft.Bcl.AsyncInterfaces.dll'...
  Packaging file 'Microsoft.Bcl.AsyncInterfaces.dll'...
  Packaging file 'Microsoft.Bcl.AsyncInterfaces.dll'...
  Packaging file 'Microsoft.Bcl.AsyncInterfaces.dll'...
  Packaging file 'Archivator_desktop_WPF_WTS.pdb'...
  Packaging file 'Archivator_desktop_WPF_WTS.pdb'...
  Packaging file 'Archivator_desktop_WPF_WTS.pdb'...
  Packaging file 'Archivator_desktop_WPF_WTS.pdb'...
  Packaging file 'ArchivatorDb.dll'...
  Packaging file 'ArchivatorDb.dll'...
  Packaging file 'ArchivatorDb.dll'...
  Packaging file 'ArchivatorDb.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.dll'...
  Packaging file 'Microsoft.Extensions.Configuration.dll'...
  ========== Rebuild All: 4 succeeded, 0 failed, 0 skipped ==========
  </code></pre>
  
  <p>Edit: I have learned that Windows installer project calls publish on the project and then packages the output, publish is supposed to resolve dependecies and include them, while build just references packages downloaded in nuget, thats why including those extra files fixed the issue, but only on my pc - they referenced the missing packages. I have also found out that the publish to file function of visual studio does not have this issue, but I have no way of using its output in installer directly. <a href="https://stackoverflow.com/a/53304641/7091281">https://stackoverflow.com/a/53304641/7091281</a></p>