Closed sonupmandal closed 3 years ago
Tagging @danroth27
You'd get better support if you filed this issue on the appropriate repo: https://github.com/dotnet/aspnetcore
@sonupmandal Both Process.GetCurrentProcess()
and Process.ProcessName
are not supported when running on WebAssembly in a browser. Browsers run your code in a security sandbox, so not all .NET APIs are available. In .NET 5 you can use the Platform Compatibility Analyzer to get design time insights into which APIs are supported when running in a browser.
@terrajobst
Thanks @mairaw Posted this issue here : https://github.com/dotnet/aspnetcore/issues/34828
I have created a simple Blazor Webassembly application in which Target Framework : .NET Standard 2.1
Contents of Counter.razor file
Upon running this application, a browser window opens, when i press click me button, i end up getting this exception. _crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: Process has exited or is inaccessible, so the requested information is not available. System.InvalidOperationException: Process has exited or is inaccessible, so the requested information is not available. at System.Diagnostics.Process.getProcessName () <0x2d34700 + 0x0004a> in:0
at WebApplication1.Pages.Counter.IncrementCount () <0x2d33d80 + 0x0000c> in :0
at Microsoft.AspNetCore.Components.EventCallbackWorkItem.InvokeAsync[T] (System.MulticastDelegate delegate, T arg) <0x2d07e80 + 0x0005e> in :0
at Microsoft.AspNetCore.Components.EventCallbackWorkItem.InvokeAsync (System.Object arg) <0x2d07bc0 + 0x0000a> in :0
at Microsoft.AspNetCore.Components.ComponentBase.Microsoft.AspNetCore.Components.IHandleEvent.HandleEventAsync (Microsoft.AspNetCore.Components.EventCallbackWorkItem callback, System.Object arg) <0x2d07b28 + 0x0000a> in :0
at Microsoft.AspNetCore.Components.EventCallback.InvokeAsync (System.Object arg) <0x2d076f0 + 0x00040> in :0
at Microsoft.AspNetCore.Components.RenderTree.Renderer.DispatchEventAsync (System.UInt64 eventHandlerId, Microsoft.AspNetCore.Components.RenderTree.EventFieldInfo fieldInfo, System.EventArgs eventArgs) <0x2d06ce0 + 0x000a8> in :0
Can someone assist me why i am getting this error ? Is Process.GetCurrentProcess().ProcessName API not supported with Blazor webassembly app ?