SOLVED

MSIX application is not opening ReportViewer Microsoft.ReportViewer.WinForms

Copper Contributor

When I run the application exe file directly from C:\Program Files\WindowsApps it works, but not when I start it from the Start menu.

Process Monito is showing C:\WINDOWS\Microsoft.Net\assembly\GAC_32\Microsoft.ReportViewer.WinForms\v4.0_14.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.WinForms.dll PATH NOT FOUND. NuGet package is Microsoft.ReportingServices.ReportViewerControl.Winforms. Why is he looking there when files are in an app directory? I am using .NET Framework 4.8 WPF and WindowsFormsHost for displaying the ReportViewer. From an explanation of how Package Support Framework works, I still don't know what exact steps should I take or if what process monitor shows is the root problem.

23 Replies

@Tim Mangan 

Can you be more specific? Where am I suppose to put this WorkingDirectory = "", in which manifest, what project, MSIX project or my exe project or config.json? I am now in VS 2019 c# project, this now has nothing to do with c++ project PsfLauncher. Process.Start("SyriliumRiF.exe"); in c# solution points probably to system32 folder because System.Environment.CurrentDirectory is returning "c:/windows/system32".

@hbatrnek Ugh! my bad.  It goes in the Application section of the config.json file.

best response confirmed by hbatrnek (Copper Contributor)
Solution

@Tim Mangan 

 

I've resolved it with this:

            Process.Start(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "PsfLauncher32.exe"));

The problem was in the root path when starting it from windows start, root path for Process.Start is not the application folder when started as a store package.  :)

@hbatrnek I guess I missed the part that you were programmatically starting the launcher from something else.  Glad you sorted this out.