kernelbase error when forcing wpf app to run as administrator - wpf

we have a wpf application which is written with .net core 3.1 .
so for forcing wpf to run as admin we added appmanifest file and changed :
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
to
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
and below line added to project.csproj file :
<ApplicationManifest>app.manifest</ApplicationManifest>
after doing all of before step and publishing application we got an error in windows eventviewer :
Faulting application name: WpfVideoCourseApp.Presentation.exe, version: 1.0.0.0, time stamp: 0x60776cd9
Faulting module name: KERNELBASE.dll, version: 10.0.19041.1151, time stamp: 0x891df6d3
Exception code: 0xe0434352
Fault offset: 0x0000000000034ed9
Faulting process id: 0x2ac8
Faulting application start time: 0x01d7a5852476cbd1
Faulting application path: E:\VideoCourseApp\WpfVideoCourseApp.Presentation.exe
Faulting module path: C:\Windows\System32\KERNELBASE.dll
Report Id: d9b3e20f-55dc-4dd2-b0ad-40e940dedaa6
Faulting package full name:
Faulting package-relative application ID:
but afterall i should say that : app runs without any problem when using debug files(problem is all about published version of application)
Update :
in publish when i run app , app try to write something in windows document folder and access will denied(but thats not happening when running debug code)
actualy i added manifest file for having permission to reading and writing my files in some special path's(like document folder) but it just work in debug

I am afraid you can't run a ClickOnce deployed application with administrative privileges.
As a workaround, you may consider to implement your app to start a new process as an admininstrator or choose another deployment strategy.

Related

How to create a setup with crystal reports, or ms-reports in visual studio for desktop applications

I have created a desktop application in visual studio and sqlserver and when I created a setup, it is working on the development machine but when the setup is installed in the client machine together with crystal reports runtime engine, the application is not starting. I have implemented event logging and managed to get the following error for crystal reports.
Application: Crystals.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.BadImageFormatException
at CrystalDecisions.Shared.SharedUtils..cctor()
Exception Info: System.TypeInitializationException
at CrystalDecisions.Shared.SharedUtils.get_CurrentControl()
at CrystalDecisions.Shared.SharedUtils.GetEffectiveCulture()
at CrystalDecisions.Shared.LocaleManager..ctor()
at CrystalDecisions.Windows.Forms.CrystalReportViewer.InitReportViewer()
at CrystalDecisions.Windows.Forms.CrystalReportViewer..ctor()
at Crystals.Form1.InitializeComponent()
at Crystals.Form1..ctor()
Exception Info: System.InvalidOperationException
at Crystals.My.MyProject+MyForms.Create__Instance__[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.__Canon)
at Crystals.My.MyProject+MyForms.get_Form1()
at Crystals.My.MyApplication.OnCreateMainForm()
at Microsoft.VisualBasic.ApplicationServices
I have also tried Microsoft Report Viewer RDLC and it is returning the following error
Faulting Application name:ReportViewerSample.exe,version:1.0.0.0, time stamp:0x6130af2a
Faulting module name:KERNELBASE.dll,version:10.0.10240.16384, time stamp:0x559f3b2a
Exception code:0xe0434352
Fault offset:0x000b3e28
Faulting process id:0x17b4
Faulting application start time:0x01d7a059329df75d
Faulting application path: C:\Program Files(x86)\Beymo\RDLCViewer\ReportViewerSample.exe
Faulting module path: C:\Windows\SYSTEM32\KERNELBASE.dll
Report id: 57ed1ef9-6ed3-418f-952a-aea23f09618b
Faulting package full name:
Faulting package-relative application ID:
Log Name: Application
Source: Application error
Event ID: 100
When I create a project without a report, it is working fine in both development environment and client machine. How can I resolve the issue?

CefSharp chromium crashing winforms 32 bit application

Hi All I am new to using CefSharp in my application. I need some help resolving an issue I am facing. I have a 32 bit winforms application and installed version 81 of cefsharp dll's. My server is a 64 bit machine. I redirect from my form to a website (ADP). Sometimes it works and sometimes it crashes with an error like below. I am not able to find what is going on and any help is really . The dll's and my application are in a folder on a server (server1). User login into a terminal server(server2) and access the application from a shortcut on the desktop. Below is the error.
Windows cannot access the file for one of the following reasons: there is a problem with the network connection, the disk that the file is stored on, or the storage drivers installed on this computer; or the disk is missing. Windows closed the program CefSharp.BrowserSubprocess because of this error.
Program: CefSharp.BrowserSubprocess
Faulting application name: CefSharp.BrowserSubprocess.exe, version: 81.3.100.0, time stamp: 0x5ec8803e
Faulting module name: libcef.dll, version: 0.0.0.0, time stamp: 0x5eac9798
Exception code: 0xc0000006
Fault offset: 0x005ae118
Faulting process id: 0x4a34
Faulting application start time: 0x01d674c9b69143f4
Faulting application path: \serverpath\CefSharp.BrowserSubprocess.exe

Outlook add-in fails to load on O365 Desktop Client

Since I updated Office 365 to Version 1908 (Build 11929.20658) I am having issues using our own developed Outlook add-in in the Outlook Desktop Client.
Outlook reports the following error:
"ADD-IN ERROR
This add-in could not be started. Close this dialog to ignore the problem or click "Restart" to try again"
The same add-in works fine in the Outlook Web in different browsers (IE, Chrome, Edge).
I followed the instructions from https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/troubleshoot-outlook-add-in-activation, but it didn't help to solve the issue.
Looking into Fiddler logs, it seems that the Outlook doesn't try to reach the server to download the add-in files.
I read about Enable Protected Mode on IE
https://learn.microsoft.com/en-us/office/troubleshoot/error-messages/apps-for-office-not-start
However, the newer Office version uses EdgeView as a web browser engine.
I also have installed on this machine the Edge Chromium version.
Is a similar configuration change need also on EdgeView?
Is there a way to troubleshoot the or collect logs when starting up the add-in inside Outlook desktop?
I rolled back Office 365 to Version 1902 (Build 11328.20492).
In this version, the add-ins work fine.
But, when updating to the latest version available Version 2002 (Build 12527.20278) the problem remains.
I've attached screenshots from Outlook Destkop (Error) and Outlook Web (OK) as additional information.
Looking into the Event Viewer / Windows Logs / Application I see the following Application Error(s) when opening the add-in inside Outlook Desktop
Event 1000, Application Error
Faulting application name: Win32WebViewHost.exe, version: 10.0.18362.329, time stamp: 0x65f1ccce Faulting module name: edgemanager.dll, version: 11.0.18362.693, time stamp: 0xb50be940
Exception code: 0xc0000409 Fault offset: 0x0000000000032baf Faulting
process id: 0x15b0 Faulting application start time: 0x01d5f97c03220670
Faulting application path:
C:\Windows\SystemApps\Microsoft.Win32WebViewHost_cw5n1h2txyewy\Win32WebViewHost.exe
Faulting module path: C:\WINDOWS\SYSTEM32\edgemanager.dll Report Id:
240488bf-a9e4-43ef-abc6-832c8b0f8a79 Faulting package full name:
Microsoft.Win32WebViewHost_10.0.18362.449_neutral_neutral_cw5n1h2txyewy
Faulting package-relative application ID: DPI.PerMonitorAware
Event 1000, Application Error
Faulting application name: RuntimeBroker.exe, version: 10.0.18362.1,
time stamp: 0x4539d5a0 Faulting module name: EdgeManager.dll, version:
11.0.18362.693, time stamp: 0xb50be940 Exception code: 0xc0000409 Fault offset: 0x0000000000022f44 Faulting process id: 0x18d8 Faulting
application start time: 0x01d5f97c035dfbc5 Faulting application path:
C:\Windows\System32\RuntimeBroker.exe Faulting module path:
C:\Windows\System32\EdgeManager.dll Report Id:
9add408f-632f-4b25-8786-eced0492536d Faulting package full name:
Microsoft.Win32WebViewHost_10.0.18362.449_neutral_neutral_cw5n1h2txyewy
Faulting package-relative application ID:
runtimebroker07f4358a809ac99a64a67c1
We had the same issue in our VDI environment and we found out that WebView2 was missing. After installing it issue is resolved. Hope that will help.
I have the same issue with VDI.
To solve this issue I try :
Reinstall M365
Delete Microsoft folder into the user's profile :
c:\users\username\appdata\local\microsoft
c:\users\username\appdata\locallow\microsoft
c:\users\username\appdata\roaming\microsoft*
It seems to be a profile issue because when I delete the user's profile, everything works perfectly.
I perform some test on a user profile to find the correct file

WPF - Deployment Issue - Faulting Module Name: KERNELBASE.dll

I am trying to install and run my first WPF application and am having a few issues. I have built a setup project and everything appears to be installing correctly, all my third party dll's are copied over, directories are created, etc... When I try to run the app, it just bombs immediately with the following error:
Faulting application name: app.exe, version: 1.0.0.0, time stamp: 0x4f8343f3
Faulting module name: KERNELBASE.dll, version: 6.1.7600.16850, time stamp: 0x4e211485
Exception code: 0xe0434352
Fault offset: 0x0000b9bc
Faulting process id: 0xdec
Faulting application start time: 0x01cd168e7b8a64fc
Faulting application path: C:\Program Files (x86)\Some Dir\Some APP\app.exe
Faulting module path: C:\Windows\syswow64\KERNELBASE.dll
Report Id: bad81009-8281-11e1-93ec-f4501845bd18
How do I go about debugging this?? I have wrapped the InitializeComponent() in a try/catch but I'm getting nothing?
All that being said, if I copy the contents of the debug directory to the program files directory on the same pc in which I am trying to install the app and then run the exe, everything works just fine?? What do I need to do differently in my setup project??
I had the exact same problem, hopefully you have fixed it by now and so I am writing this for others redirected here.
I was installing the project via an MSI executable, but the problem is, one of the file inside my project (not the installer project) was marked as "Copy Always" under its "Copy to output directory" in its properties. This project was a dependency for my MSI project but the "Copy to output" files are not being copied in the MSI file, you have to manually each one of those file inside the MSI project also. Hopefully this post made sense!
Edit: This is probably why copying files from your debug folder works, you are including the file that has previously not been copied by the MSI itself.
Ran into the same problem, but in my case I had an exception triggered in the constructor of pages referenced from the main window. Bad coding, but mentioning it here because it's not always obvious that WPF pages will be constructed before the main window is rendered.

WPF + Prism + EF outside Visual Studio Error

My app was built on .NET 4.0 with WPF, Prism, Entity Framework
There are 1 exe (the app), 1 exe (the app config - simple app to restore db, no referenced dll no prism and no EF), and several referenced DLLs like the prism-way, SQL Server 2008 Express. All assemblies and Exe are built with target platform AnyCpu.
I tested in my development environment(Win764bits, VS2010, .NET4...), no problem. Then I tested in Windows 7 32 bits and the app config works well. But the app runs perfectly only if the Visual Studio is installed. Without VS 2010, I got the 2 errors in event log:
Application Error:
Faulting application name: App.exe, version: 1.0.0.0, time stamp: 0x4df473d0
Faulting module name: KERNELBASE.dll, version: 6.1.7600.16385, time stamp: 0x4a5bdaae
Exception code: 0xe0434352
Fault offset: 0x00009617
Faulting process id: 0xa28
Faulting application start time: 0x01cc2aa91326a10e
Faulting application path: C:......\Release\App.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Report Id: 52f2c510-969c-11e0-98bf-000c299e51f4
.NET Runtime:
Application: App.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: Microsoft.Practices.Prism.Modularity.ModuleInitializeException
Stack:
at Microsoft.Practices.Prism.Modularity.ModuleInitializer.HandleModuleInitializationError(Microsoft.Practices.Prism.Modularity.ModuleInfo, System.String, System.Exception)
at Microsoft.Practices.Prism.Modularity.ModuleInitializer.Initialize(Microsoft.Practices.Prism.Modularity.ModuleInfo)
at Microsoft.Practices.Prism.Modularity.ModuleManager.LoadModulesThatAreReadyForLoad()
at Microsoft.Practices.Prism.Modularity.ModuleManager.LoadModuleTypes(System.Collections.Generic.IEnumerable`1)
at Microsoft.Practices.Prism.Modularity.ModuleManager.LoadModulesWhenAvailable()
at Microsoft.Practices.Prism.Modularity.ModuleManager.Run()
at ...
I've searched and tried to fix, but It's the same.
Please help me
Many thanks and regards!
I've found that one of my DLL using ReportViewer. Just installed this one and the problem was resolved
http://www.microsoft.com/download/en/confirmation.aspx?id=6442

Resources