Repository navigation
System.ArgumentException: 'The path is not of a legal form.' #19
Copy link
Copy link
Closed
Description
HResult=0x80070057
Message=The path is not of a legal form.
Source=mscorlib
StackTrace:
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.InternalGetDirectoryName(String path)
at Microsoft.Web.WebView2.Core.CoreWebView2Environment.GetAssemblyLocationDirectory()
at Microsoft.Web.WebView2.Core.CoreWebView2Environment.LoadWebView2LoaderDll()
at Microsoft.Web.WebView2.Core.CoreWebView2Environment.GetAvailableBrowserVersionString(String browserExecutableFolder)
at XboxAuthNet.Platforms.WinForm.WebView2WebUI.IsWebView2Available()
at XboxAuthNet.PlatformManager.CreateWebUI(WebUIOptions uiOptions)
at XboxAuthNet.OAuth.CodeFlow.CodeFlowBuilder.createDefaultWebUIForPlatform()
at XboxAuthNet.OAuth.CodeFlow.CodeFlowBuilder.Build()
at XboxAuthNet.Game.OAuth.InteractiveMicrosoftOAuth.<Authenticate>d__3.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at XboxAuthNet.Game.OAuth.MicrosoftOAuth.<Authenticate>d__2.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.ValueTask`1.get_Result()
at XboxAuthNet.Game.Authenticators.SessionAuthenticator`1.<ExecuteAsync>d__6.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at XboxAuthNet.Game.Authenticators.NestedAuthenticator.<doInnerAuth>d__6.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at XboxAuthNet.Game.Authenticators.NestedAuthenticator.<doInnerAuth>d__6.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at XboxAuthNet.Game.Authenticators.NestedAuthenticator.<doInnerAuth>d__6.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at XboxAuthNet.Game.Authenticators.NestedAuthenticator.<ExecuteAsync>d__5.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at XboxAuthNet.Game.Authenticators.NestedAuthenticator.<ExecuteAsync>d__4.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.ValueTask`1.get_Result()
at CmlLib.Core.Auth.Microsoft.Extensions.<ExecuteForLauncherAsync>d__10.MoveNext() in C:\Users\pronn\Downloads\CmlLib.Core.Auth.Microsoft-dev\CmlLib.Core.Auth.Microsoft-dev\src\CmlLib.Core.Auth.Microsoft\Extensions.cs:line 88
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Leaf_Client.MainForm.<btnFTMicrosoft_Click>d__7.MoveNext() in C:\Users\pronn\Downloads\CmlLib.Core-master\CmlLib.Core-master\Leaf Client\MainForm.cs:line 94
Code:
var loginHandler = JELoginWrapper.Instance.LoginHandler;
//var session = await loginHandler.AuthenticateInteractively();
var authenticator = loginHandler.CreateAuthenticatorWithNewAccount();
authenticator.AddForceMicrosoftOAuthForJE(oauth => oauth.Interactive());
authenticator.AddXboxAuthForJE(xbox => xbox.Basic());
authenticator.AddForceJEAuthenticator();
var session = await authenticator.ExecuteForLauncherAsync();
Console.WriteLine("Logged in successfully with account " + session.Username + ".");```Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
xauuzd commentedon Jan 25, 2024
Why is this happening? And what's the fix?
xauuzd commentedon Jan 25, 2024
Btw I'm using .NET WinForms, is that the issue?
xauuzd commentedon Jan 25, 2024
I also tried this:
But I still get the same issue.
xauuzd commentedon Jan 25, 2024
So I found the solution, and the issue.
Issue: WebView2 & Fody.Costura packages
Solution: All you have to do is literally just update the packages that come with CmLib's packages (including WebView2, Fody.Costura). It's been fixed in the new versions so that's great. I recommend you pin this issue just in case anyone has the same one.
AlphaBs commentedon Jan 27, 2024
I also suffered this issue with WebView2 and Fody before. thank you for reporting