microsoft / appcenter-sdk-dotnet

Development repository for the App Center SDK for .NET platforms, including Xamarin
Other
307 stars 141 forks source link

WPF project - "The path is not of a legal form" #1068

Closed nabeelio closed 4 years ago

nabeelio commented 4 years ago

Description

Getting an exception on calling AppCenter.Start(). I'm looking through the demo project(s) and I'm not seeing anything obvious that I might be missing.

System.ArgumentException
  HResult=0x80070057
  Message=The path is not of a legal form.
  Source=mscorlib
  StackTrace:
   at System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.InternalGetDirectoryName(String path)
   at Microsoft.AppCenter.Utils.DefaultApplicationSettings.OpenConfiguration()
   at Microsoft.AppCenter.Utils.DefaultApplicationSettings.ReadAll()
   at Microsoft.AppCenter.Utils.DefaultApplicationSettings..ctor()
   at Microsoft.AppCenter.AppCenter..ctor()
   at Microsoft.AppCenter.AppCenter.get_Instance()
   at Microsoft.AppCenter.AppCenter.PlatformStart(String appSecret, Type[] services)
   at Microsoft.AppCenter.AppCenter.Start(String appSecret, Type[] services)
   at Acars.App.OnStartup(StartupEventArgs e) in C:\Users\Nabeel\source\repos\ACARS\AcarsClient\App.xaml.cs:line 30
   at System.Windows.Application.<.ctor>b__1_0(Object unused)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()
   at Acars.App.Main()

Repro Steps

Please list the steps used to reproduce your issue.

  1. Starting up the app

I've also tried to invoke DefaultApplicationSettings() directly, and also getting that error thrown:

var appSettings = new Microsoft.AppCenter.Utils.DefaultApplicationSettings();

Details

  1. What is your app platform (Xamarin.Android or Xamarin.iOS or UWP)?
    • WPF
    • .NET 4.7.2 target
  2. Which SDK version are you using?
    • v2.2.1-preview
  3. Which OS version did you experience the issue on?
    • Windows 10
  4. What device version did you see this error on? Were you using an emulator or a physical device?
    • e.g. iPhone X physical device, Google Pixel 2 emulator
  5. What third party libraries are you using?
<ItemGroup>
    <PackageReference Include="CommonServiceLocator">
      <Version>2.0.4</Version>
    </PackageReference>
    <PackageReference Include="ConcurrentHashSet">
      <Version>1.1.0</Version>
    </PackageReference>
    <PackageReference Include="ControlzEx">
      <Version>3.0.2.4</Version>
    </PackageReference>
    <PackageReference Include="Costura.Fody">
      <Version>3.3.3</Version>
    </PackageReference>
    <PackageReference Include="DeltaCompressionDotNet">
      <Version>2.0.0</Version>
    </PackageReference>
    <PackageReference Include="Discord.Net">
      <Version>2.1.0</Version>
    </PackageReference>
    <PackageReference Include="DiscordRichPresence">
      <Version>1.0.115</Version>
    </PackageReference>
    <PackageReference Include="Fody">
      <Version>4.2.1</Version>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
    <PackageReference Include="FSUIPCClientDLL">
      <Version>3.1.11</Version>
    </PackageReference>
    <PackageReference Include="GMap.Net.WPF">
      <Version>1.0.0.1</Version>
    </PackageReference>
    <PackageReference Include="LiteDB">
      <Version>4.1.4</Version>
    </PackageReference>
    <PackageReference Include="MahApps.Metro">
      <Version>1.6.5</Version>
    </PackageReference>
    <PackageReference Include="MahApps.Metro.Resources">
      <Version>0.6.1</Version>
    </PackageReference>
    <PackageReference Include="MahApps.Metro.SimpleChildWindow">
      <Version>1.5.0</Version>
    </PackageReference>
    <PackageReference Include="MaterialDesignColors">
      <Version>1.2.0</Version>
    </PackageReference>
    <PackageReference Include="MaterialDesignThemes">
      <Version>2.6.0</Version>
    </PackageReference>
    <PackageReference Include="MaterialDesignThemes.MahApps">
      <Version>0.1.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.AppCenter">
      <Version>2.2.1-preview</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.AppCenter.Analytics">
      <Version>2.2.1-preview</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.AppCenter.Crashes">
      <Version>2.2.1-preview</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.ApplicationInsights">
      <Version>2.7.2</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Extensions.Configuration">
      <Version>2.2.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions">
      <Version>2.2.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions">
      <Version>2.2.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Extensions.Configuration.Xml">
      <Version>2.2.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Extensions.FileProviders.Abstractions">
      <Version>2.2.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Extensions.FileProviders.Physical">
      <Version>2.2.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Extensions.FileSystemGlobbing">
      <Version>2.2.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Extensions.Primitives">
      <Version>2.2.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.NETCore.Platforms">
      <Version>2.2.2</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Win32.Primitives">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="Mono.Cecil">
      <Version>0.10.4</Version>
    </PackageReference>
    <PackageReference Include="MoonSharp">
      <Version>2.0.0</Version>
    </PackageReference>
    <PackageReference Include="NETStandard.Library">
      <Version>2.0.3</Version>
    </PackageReference>
    <PackageReference Include="Newtonsoft.Json">
      <Version>12.0.2</Version>
    </PackageReference>
    <PackageReference Include="NLog">
      <Version>4.6.6</Version>
    </PackageReference>
    <PackageReference Include="NLog.Config">
      <Version>4.6.6</Version>
    </PackageReference>
    <PackageReference Include="NLog.Schema">
      <Version>4.6.6</Version>
    </PackageReference>
    <PackageReference Include="Prism.Core">
      <Version>7.0.0.396</Version>
    </PackageReference>
    <PackageReference Include="Prism.Unity">
      <Version>6.3.0</Version>
    </PackageReference>
    <PackageReference Include="Prism.Wpf">
      <Version>6.3.0</Version>
    </PackageReference>
    <PackageReference Include="RestSharp">
      <Version>106.6.10</Version>
    </PackageReference>
    <PackageReference Include="Scriban">
      <Version>2.1.0</Version>
    </PackageReference>
    <PackageReference Include="SharpCompress">
      <Version>0.23.0</Version>
    </PackageReference>
    <PackageReference Include="Splat">
      <Version>8.1.1</Version>
    </PackageReference>
    <PackageReference Include="sqlite-net-pcl">
      <Version>1.5.231</Version>
    </PackageReference>
    <PackageReference Include="SQLitePCLRaw.bundle_green">
      <Version>1.1.14</Version>
    </PackageReference>
    <PackageReference Include="SQLitePCLRaw.core">
      <Version>1.1.14</Version>
    </PackageReference>
    <PackageReference Include="SQLitePCLRaw.lib.e_sqlite3.linux">
      <Version>1.1.14</Version>
    </PackageReference>
    <PackageReference Include="SQLitePCLRaw.lib.e_sqlite3.osx">
      <Version>1.1.14</Version>
    </PackageReference>
    <PackageReference Include="SQLitePCLRaw.lib.e_sqlite3.v110_xp">
      <Version>1.1.14</Version>
    </PackageReference>
    <PackageReference Include="SQLitePCLRaw.provider.e_sqlite3.net45">
      <Version>1.1.14</Version>
    </PackageReference>
    <PackageReference Include="Stateless">
      <Version>4.2.1</Version>
    </PackageReference>
    <PackageReference Include="System.AppContext">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Buffers">
      <Version>4.5.0</Version>
    </PackageReference>
    <PackageReference Include="System.Collections">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Collections.Concurrent">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.ComponentModel.Annotations">
      <Version>4.5.0</Version>
    </PackageReference>
    <PackageReference Include="System.Console">
      <Version>4.3.1</Version>
    </PackageReference>
    <PackageReference Include="System.Diagnostics.Debug">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Diagnostics.DiagnosticSource">
      <Version>4.5.1</Version>
    </PackageReference>
    <PackageReference Include="System.Diagnostics.Tools">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Diagnostics.Tracing">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Globalization">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Globalization.Calendars">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.IO">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.IO.Compression">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.IO.Compression.ZipFile">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.IO.FileSystem">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.IO.FileSystem.Primitives">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Linq">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Linq.Expressions">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Memory">
      <Version>4.5.3</Version>
    </PackageReference>
    <PackageReference Include="System.Net.Http">
      <Version>4.3.4</Version>
    </PackageReference>
    <PackageReference Include="System.Net.Primitives">
      <Version>4.3.1</Version>
    </PackageReference>
    <PackageReference Include="System.Net.Sockets">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Numerics.Vectors">
      <Version>4.5.0</Version>
    </PackageReference>
    <PackageReference Include="System.ObjectModel">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Reflection">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Reflection.Extensions">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Reflection.Primitives">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Resources.ResourceManager">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Runtime">
      <Version>4.3.1</Version>
    </PackageReference>
    <PackageReference Include="System.Runtime.CompilerServices.Unsafe">
      <Version>4.5.2</Version>
    </PackageReference>
    <PackageReference Include="System.Runtime.Extensions">
      <Version>4.3.1</Version>
    </PackageReference>
    <PackageReference Include="System.Runtime.Handles">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Runtime.InteropServices">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Runtime.InteropServices.RuntimeInformation">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Runtime.Numerics">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Security.AccessControl">
      <Version>4.5.0</Version>
    </PackageReference>
    <PackageReference Include="System.Security.Cryptography.Algorithms">
      <Version>4.3.1</Version>
    </PackageReference>
    <PackageReference Include="System.Security.Cryptography.Encoding">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Security.Cryptography.Primitives">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Security.Cryptography.X509Certificates">
      <Version>4.3.2</Version>
    </PackageReference>
    <PackageReference Include="System.Security.Cryptography.Xml">
      <Version>4.5.0</Version>
    </PackageReference>
    <PackageReference Include="System.Security.Permissions">
      <Version>4.5.0</Version>
    </PackageReference>
    <PackageReference Include="System.Security.Principal.Windows">
      <Version>4.5.1</Version>
    </PackageReference>
    <PackageReference Include="System.Text.Encoding">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Text.Encoding.Extensions">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Text.RegularExpressions">
      <Version>4.3.1</Version>
    </PackageReference>
    <PackageReference Include="System.Threading">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Threading.Tasks">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Threading.Timer">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="System.Xml.ReaderWriter">
      <Version>4.3.1</Version>
    </PackageReference>
    <PackageReference Include="System.Xml.XDocument">
      <Version>4.3.0</Version>
    </PackageReference>
    <PackageReference Include="Unity">
      <Version>5.11.1</Version>
    </PackageReference>
  </ItemGroup>
Jamminroot commented 4 years ago

Hello, @nabeelio, apologies for a delayed response. It is a known problem which was recently fixed (have a look at this PR), and should be included in next release of SDK.

nabeelio commented 4 years ago

Thanks for the info! Looking forward to the next release

guperrot commented 4 years ago

You can test the fix in version 2.3.0-preview that was released.

poumason commented 4 years ago

I try use the 2.3.0-preview, the bug still exist. I use .net framework 4.5.2.

2019-09-02 10:30:46.523 [AppCenter] WARN: Could not check/migrate old config file
System.ArgumentException: The path is not of a legal form.
   at System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.InternalGetDirectoryName(String path)
   at Microsoft.AppCenter.Utils.DefaultApplicationSettings.OpenConfiguration()

Process is terminated due to StackOverflowException.
An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll
guperrot commented 4 years ago

Hi, this is just a warning now to say we could not check the old file location (the code proceeds to use the new path).

The stack overflow seems unrelated, is that your application crashing for some other reason?

nabeelio commented 4 years ago

I'm getting another error now, though I'll open a new issue:

System.TypeInitializationException
  HResult=0x80131534
  Message=The type initializer for 'Microsoft.AppCenter.Utils.Constants' threw an exception.
  Source=Microsoft.AppCenter
  StackTrace:
   at Microsoft.AppCenter.Storage.Storage.DefaultAdapter()
   at Microsoft.AppCenter.AppCenter.InstanceConfigure(String appSecretOrSecrets)
   at Microsoft.AppCenter.AppCenter.PlatformStart(String appSecret, Type[] services)
   at Microsoft.AppCenter.AppCenter.Start(String appSecret, Type[] services)
   at Acars.App.CreateShell() in C:\Users\Nabeel\source\repos\ACARS\AcarsClient\App.xaml.cs:line 91
   at Prism.PrismApplicationBase.Initialize() in d:\a\1\s\Source\Wpf\Prism.Wpf\PrismApplicationBase.cs:line 84
   at Prism.PrismApplicationBase.InitializeInternal() in d:\a\1\s\Source\Wpf\Prism.Wpf\PrismApplicationBase.cs:line 46
   at Prism.PrismApplicationBase.OnStartup(StartupEventArgs e) in d:\a\1\s\Source\Wpf\Prism.Wpf\PrismApplicationBase.cs:line 37
   at System.Windows.Application.<.ctor>b__1_0(Object unused)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()
   at Acars.App.Main()

Inner Exception 1:
ConfigurationErrorsException: Unable to save config to file 'C:\Users\...\AppData\Local\phpVMS\acars.exe_Url_qvl4ekumnzcu5otwp4l1ouhhyqs0jrdk\AppCenter.config'.