[Entwicklung] Social Network.NET

Es gibt 613 Antworten in diesem Thema. Der letzte Beitrag () ist von AliveDevil.

    Damn...>.< Mono mag meinen Code nicht
    Spoiler anzeigen

    Quellcode

    1. Social Network.NET Server wird gestartet...
    2. Lade Einstellungen...
    3. Unhandled Exception: System.InvalidCastException: Cannot cast from source type to destination type.
    4. at System.Xml.XmlCharType.InitInstance () [0x00000]
    5. at System.Xml.XmlCharType.get_Instance () [0x00000]
    6. at System.Xml.XmlTextReaderImpl..ctor (System.Xml.XmlNameTable nt) [0x00000]
    7. at System.Xml.XmlTextReaderImpl..ctor (System.String url, System.IO.Stream input, System.Xml.XmlNameTable nt) [0x00000]
    8. at System.Xml.XmlTextReaderImpl..ctor (System.IO.Stream input) [0x00000]
    9. at System.Xml.XmlTextReader..ctor (System.IO.Stream input) [0x00000]
    10. at System.Configuration.Configuration.Load () [0x00000]
    11. at System.Configuration.Configuration.Init (IConfigSystem system, System.String configPath, System.Configuration.Configuration parent) [0x00000]
    12. at System.Configuration.Configuration..ctor (System.Configuration.InternalConfigurationSystem system, System.String locationSubPath) [0x00000]
    13. at System.Configuration.Configuration..ctor (System.Configuration.InternalConfigurationSystem system, System.String locationSubPath) [0x00000]
    14. at System.Configuration.Configuration..ctor (System.Configuration.InternalConfigurationSystem system, System.String locationSubPath) [0x00000]
    15. at System.Configuration.Configuration..ctor (System.Configuration.InternalConfigurationSystem system, System.String locationSubPath) [0x00000]
    16. at System.Configuration.InternalConfigurationFactory.Create (System.Type typeConfigHost, System.Object[] hostInitConfigurationParams) [0x00000]
    17. at System.Configuration.ConfigurationManager.OpenExeConfigurationInternal (ConfigurationUserLevel userLevel, System.Reflection.Assembly calling_assembly, System.String exePath) [0x00000]
    18. at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (System.String configKey) [0x00000]
    19. at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00000]
    20. at System.Configuration.ConfigurationSettings.GetConfig (System.String sectionName) [0x00000]
    21. at System.Diagnostics.DiagnosticsConfiguration.get_Settings () [0x00000]
    22. at System.Diagnostics.Switch.GetConfigFileSetting () [0x00000]
    23. at System.Diagnostics.Switch.get_SwitchSetting () [0x00000]
    24. at System.Diagnostics.BooleanSwitch.get_Enabled () [0x00000]
    25. at System.Xml.Serialization.TempAssembly.LoadGeneratedAssembly (System.Type type, System.String defaultNamespace, System.Xml.Serialization.XmlSerializerImplementation& contract) [0x00000]
    26. at System.Xml.Serialization.XmlSerializer..ctor (System.Type type, System.String defaultNamespace) [0x00000]
    27. at System.Xml.Serialization.XmlSerializer..ctor (System.Type type) [0x00000]
    28. at Social_Network_NET_Server.Account.Save (System.Collections.Generic.List`1 List, System.String FileName) [0x00000]
    29. at Social_Network_NET_Server.Module1.Main () [0x00000]

    Wird sich noch etwas herauszögern...
    Naja...drei Leben^^
    Nein.

    Ich habe ein Problem mit der Serialisierung.
    Ich habe keine Ahnung, warums vorher ging...und jetzt auf einmal nicht mehr.

    Deswegen: kann mir jemand, bei er Serialisierung helfen?
    Ich muss nur immer wieder zwei Klassen speichern und laden. Thats all.
    Bisher so:

    VB.NET-Quellcode

    1. Public Shared Sub Save(ByVal List As List(Of Account), ByVal ort As String)
    2. If IO.File.Exists(ort) Then
    3. IO.File.Delete(ort)
    4. End If
    5. Using fs As New FileStream(ort, FileMode.OpenOrCreate)
    6. Dim Serializer As New XmlSerializer(GetType(List(Of Account)))
    7. Serializer.Serialize(fs, List)
    8. fs.Close()
    9. End Using
    10. End Sub
    11. Public Shared Function Load(ByVal Ort As String) As List(Of Account)
    12. If Not IO.File.Exists(Ort) Then
    13. Return Nothing
    14. End If
    15. Dim result As List(Of Account)
    16. Using fs As New FileStream(Ort, FileMode.Open)
    17. Dim serializer As New XmlSerializer(GetType(List(Of Account)))
    18. result = serializer.Deserialize(fs)
    19. End Using
    20. Return result
    21. End Function

    Samus Aran schrieb:

    Was haben alle mit ihrem pixeligen Kackrendering? 8|
    Ich habe lediglich die Screenshots beurteilt. Und da es bei mir genau so aussieht, wie ich von anderen WPF Anwendungen weiß, wirds wohl an WPF liegen. Nur weil du genau der eine von 10000 bist, der das perfekte 1337 Rendering installiert hat, sieht es noch lange nicht bei jedem gut aus

    Skybird schrieb:

    Das sind ja Ubisoftmethoden hier !

    hey, wo macht die serialisierung denn probleme?
    ps: interessantes projekt! bin mal gespannt was da noch so neues bei rumkommt!^^

    Edit: ich las gerade, dass du zwei klassen speichern und laden willst - was sind das für klassen? wenn sie weitere instanzen von dir erstellten klassen enthalten kann es daran liegen (zumindest trat beim clonen solcher klassen ein fehler auf, stichwort deep clone).

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „FreakJNS“ ()

    @vb-checker: Ich nutze im Moment ClearType, weil die andere Renderingmethode beim Programmieren hinderlich ist.
    Und die Textdarstellung hier (vb-paradise.de/index.php?page=Attachment&attachmentID=11849) ist perfekt.

    @AliveDevil: Probier das:

    VB.NET-Quellcode

    1. Public Shared Function readXML() As DeineKlasse
    2. Try
    3. If File.Exists("Pfad zur XML") Then
    4. Dim dk As New DeineKlasse
    5. Dim x As New Xml.Serialization.XmlSerializer(dk.GetType)
    6. Dim enc As New System.Text.UTF8Encoding
    7. Using fs As New FileStream("Pfad zur XML", FileMode.Open)
    8. Return DirectCast(x.Deserialize(fs), Deine Klasse)
    9. End Using
    10. Else
    11. Return New Deine Klasse
    12. End If
    13. Catch ex As Exception
    14. Return New Deine Klasse
    15. End Try
    16. End Function
    17. Public Shared Function writeXML(ByVal dk As DeineKlasse) As Boolean
    18. Try
    19. Dim x As New Xml.Serialization.XmlSerializer(dk.GetType())
    20. Dim enc As New System.Text.UTF8Encoding
    21. Dim xml As New Xml.XmlTextWriter("Pfad zur XML", enc)
    22. x.Serialize(xml, dk)
    23. Return True
    24. Catch ex As Exception
    25. Return False
    26. End Try
    27. End Function
    Oder auch nicht.
    Die Fehler häufen sich hier.

    Erst Probleme beim Binärserialisieren, jetzt beim Threading und TCPServern.

    Mensch..das gibts doch nicht X(

    Da mich Florian gerade angeschrieben hat und mir einen seiner vServer angeboten hat, werde ich die kacke mit der Kompatibilität mal schon sein lassen und erstmal darauf aus sein, den Server zum laufen zu bringen.
    Florian wird dann ab dem offenen Test in den Credits aufgeführt.