I have an C# .NET app that I tried packaging both as appxbundle and msix to use as a Kiosk application. Both works when launched normally but fails to load when run after setting up assigned access. I used "Set-AssignedAccess" to set it up. There are no error logs being created, I have added logs pretty much everywhere. I have also added the certificates to trusted root certs.
It is outputting the entire applications debug log for startup. Which leads me to believe no errors are being thrown causing the app to crash.
It also creates a "config.json" file which should only be created if the React app hosted in the webview2 calls an API to get config and the file doesn't exist(expected on first launch). This confirms both my react app hosting, and hosting works for port 5050.
IMPORTANT: I am getting the same issue with only a text block app(code below). Created fresh with no other changes to speak of. Any changes from standard template(other than the text block itself) was made to try and fix the issue.
Some additional info:
Screenshot of app running in normal launch(Not kiosk)
I have
asp .net core apis
reverse proxy
react app hosted for Webview2
Launching Tabtip.exe for touch input. This only happens on input focus.
App.xaml.cs:
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.InteropServices.WindowsRuntime; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Controls.Primitives; using Microsoft.UI.Xaml.Data; using Microsoft.UI.Xaml.Input; using Microsoft.UI.Xaml.Media; using Microsoft.UI.Xaml.Navigation; using Microsoft.UI.Xaml.Shapes; using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; using Windows.Foundation; using Windows.Foundation.Collections; // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info. namespace Blank_text_box { public partial class App : Application { private Window? _window; public App() { InitializeComponent(); } protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) { _window = new MainWindow(); _window.Activate(); } } }App.xaml:
<?xml version="1.0" encoding="utf-8"?> <Application x:Class="Blank_text_box.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:Blank_text_box"> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" /> <!-- Other merged dictionaries here --> </ResourceDictionary.MergedDictionaries> <!-- Other app resources here --> </ResourceDictionary> </Application.Resources> </Application>
Mainwindow.xaml.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using Windows.Foundation;
using Windows.Foundation.Collections;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace Blank_text_box
{
/// <summary>
/// An empty window that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}
Mainwindow.xaml:
<?xml version="1.0" encoding="utf-8"?>
<Window
x:Class="Blank_text_box.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Blank_text_box"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="Blank_text_box">
<Window.SystemBackdrop>
<MicaBackdrop />
</Window.SystemBackdrop>
<Grid>
<TextBlock Text="HELLO KIOSK"
Foreground="White"
FontSize="72"
HorizontalAlignment="Center"
VerticalAlignment="Center"
TextAlignment="Center"/>
</Grid>
</Window>
I also generated a self signed certificate and used that .pfx when signing the app package.
The ".msixbundle" file was generated, the folder also contained the ".cer" file which i installed to trusted store and trusted people. It shows up a "SignatureKind: Developer"(I dont know if this is an issue)
The Above code is not my original code, this is a demo code which also has the same exact issue of blackscreen and windows error "ding" on mouse click input(left and right clicks).