X-Hax / SA-Mod-Manager

A new mod manager for the Sonic Adventure games.
MIT License
60 stars 17 forks source link

(Invalid) Crash with ConfigSchema #159

Closed SanicBoi74 closed 3 months ago

SanicBoi74 commented 3 months ago
I was attempting to make a mod config and I copied the code you gave as an example into an .xml file but made edits where I saw fit with my mod's purpose. When I attempted to save it and click Configure when I selected my mod, it came up with this error.

Exception Report

SAMM Information:
    Manager Version: 1.2.10
    Current Game: Sonic Adventure 2
    Game Directory: C:\Program Files (x86)\Steam\steamapps\common\Sonic Adventure 2
    Manager Location: C:\Users\dayto\OneDrive\Desktop\
    Running as Admin: False
    Mod Loader Version (Hash): ae64b42170040cee81071564cedff6b278f82dd1
Exception Information:
    Type: InvalidOperationException
    Exception: There is an error in XML document (1, 16).
    Source: System.Private.Xml
    In Function: System.Object Deserialize(System.Xml.XmlReader, System.String, System.Xml.Serialization.XmlDeserializationEvents)
    StackTrace:    at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
       at System.Xml.Serialization.XmlSerializer.Deserialize(Stream stream)
       at SAModManager.Configuration.ConfigSchema.Load(String filename)
       at SAModManager.ModsCommon.ConfigSettings..ctor(String path)
       at SAModManager.ModsCommon.ModConfig.Init()
       at SAModManager.ModsCommon.ModConfig..ctor(String Modname, String path)
       at SAModManager.MainWindow.InitModConfig()
       at SAModManager.MainWindow.ConfigureModBtn_Click(Object sender, RoutedEventArgs e)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.Controls.Primitives.ButtonBase.OnClick()
       at System.Windows.Controls.Button.OnClick()
       at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
       at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at System.Windows.Interop.HwndSource.InputFilterMessage(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.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at SAModManager.App.Main()
    InnerException: System.Xml.XmlException: Version number '4.0' is invalid. Line 1, position 16.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
   at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl)
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.XmlReader.MoveToContent()
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderConfigSchema.Read7_ConfigSchema()
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
ItsEasyActually commented 3 months ago

As the error states, there is an error in your configschema.

The tutorial states that if you get this type of error to come and ask for assistance in the X-Hax Discord. If you decide to do that, please close this issue.

I'm willing to leave it open for a little bit and assist you here if you dont want to get assistance in X-Hax, but this type of assistance isn't want the Issues here are for.