Forum Discussion
MSIX application is not opening ReportViewer Microsoft.ReportViewer.WinForms
- Mar 16, 2020
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. 🙂
Now I realized that the packaged application default directory is c:\windows\system32 and that is why he is unable to Process.Start the exe in the project directory. "System.ComponentModel.Win32Exception: 'The system cannot find the file specified'". What am I supposed to do, is PsfLauncher unable to work with the Windows Application Packaging Project in Visual Studio?
When you do this:
he overrides PsfLauncher32.exe
<Applications>
<Application Id="SyriliumRiF"
Executable="PsfLauncher32.exe"
EntryPoint="Windows.FullTrustApplication">
<uap:VisualElements
DisplayName="SyriliumRiF"
Description="SyriliumRiF"
Square150x150Logo="Images\Square150x150Logo.png"
Square44x44Logo="Images\Square44x44Logo.png" BackgroundColor="white">
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" Square71x71Logo="Images\SmallTile.png" Square310x310Logo="Images\LargeTile.png" >
</uap:DefaultTile >
<uap:SplashScreen Image="Images\SplashScreen.png" />
<uap:LockScreen BadgeLogo="Images\BadgeLogo.png" Notification="badgeAndTileText"/>
</uap:VisualElements>
</Application>
</Applications>
with project's exe referenced in:
Was anyone able to solve this or it's unsolvable for the moment?
Did anyone try to solve this through Windows Application Packaging Project?
MSIX Packaging Tool seems crap to me because he is doing packaging by the principle of recording what program is doing and accessing, that is not what I want for my VS solution, for VS solution they've created a Windows Application Packaging Project, but maybe it's still in its infancy.
hbatrnek To set the working directory to the root of the package folder, in the manifest use
WorkingDirectory = ""
- Tim ManganMar 17, 2020MVP
hbatrnek I guess I missed the part that you were programmatically starting the launcher from something else. Glad you sorted this out.
- hbatrnekMar 16, 2020Copper Contributor
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. 🙂
- Tim ManganMar 16, 2020MVP
hbatrnek Ugh! my bad. It goes in the Application section of the config.json file.
- hbatrnekMar 16, 2020Copper Contributor
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".