Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. XmlSerializer not always working

XmlSerializer not always working

Scheduled Pinned Locked Moved C#
helpquestiondata-structurestoolsxml
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JoZ CaVaLLo
    wrote on last edited by
    #1

    Hi people!!! I had to develop an application that has to work as standalone and also as "add on" of some ERP systems. One of the things done in my program is to have an object serialized to an XML File. It works 90% of the time... but under ONE of the ERP Systems (SAP) I get a System.InvalidOperationException: "There was an error generating the XML document", InnerException is "Could not load file or assembly 'Swissdec..." What is driven me crazy is that this exception is generated inside that assembly... Does somebody have an idea??? here is the stack: Title: System.InvalidOperationException Date/Time: 19.12.2008 08:53:43 Message: There was an error generating the XML document. StackTrace: at SCS.Swissdec.XmlGenerator.GenerateXmlFileAsDeclareSalary(String pPathToGenerate) at SCS.Swissdec.SwissdecLogic.Send(DateTime pFromDate, DateTime pToDate, String pSubstituteRequestId) at SCS.SalaryGUI.Tools.SwissdecControl.btnSend_Click(Object sender, EventArgs e) ****************************** Message: Could not load file or assembly 'Swissdec, Version=10.10.108.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) StackTrace: at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterDeclareSalary.Write81_DeclareSalary(Object o) ****************************** Message: String cannot have zero length. StackTrace: at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, StackCrawlMark& stackMark) at System.Reflection.Assembly.LoadFrom(String assemblyFile) at SCS.Salary_B1AddOn.currentDomain_AssemblyResolve(Object sender, ResolveEventArgs args) at System.AppDomain.OnAssemblyResolveEvent(String assemblyFullName) ******************************

    Life is not short... the problem is only how you organize yourself

    J 1 Reply Last reply
    0
    • J JoZ CaVaLLo

      Hi people!!! I had to develop an application that has to work as standalone and also as "add on" of some ERP systems. One of the things done in my program is to have an object serialized to an XML File. It works 90% of the time... but under ONE of the ERP Systems (SAP) I get a System.InvalidOperationException: "There was an error generating the XML document", InnerException is "Could not load file or assembly 'Swissdec..." What is driven me crazy is that this exception is generated inside that assembly... Does somebody have an idea??? here is the stack: Title: System.InvalidOperationException Date/Time: 19.12.2008 08:53:43 Message: There was an error generating the XML document. StackTrace: at SCS.Swissdec.XmlGenerator.GenerateXmlFileAsDeclareSalary(String pPathToGenerate) at SCS.Swissdec.SwissdecLogic.Send(DateTime pFromDate, DateTime pToDate, String pSubstituteRequestId) at SCS.SalaryGUI.Tools.SwissdecControl.btnSend_Click(Object sender, EventArgs e) ****************************** Message: Could not load file or assembly 'Swissdec, Version=10.10.108.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) StackTrace: at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterDeclareSalary.Write81_DeclareSalary(Object o) ****************************** Message: String cannot have zero length. StackTrace: at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, StackCrawlMark& stackMark) at System.Reflection.Assembly.LoadFrom(String assemblyFile) at SCS.Salary_B1AddOn.currentDomain_AssemblyResolve(Object sender, ResolveEventArgs args) at System.AppDomain.OnAssemblyResolveEvent(String assemblyFullName) ******************************

      Life is not short... the problem is only how you organize yourself

      J Offline
      J Offline
      JoZ CaVaLLo
      wrote on last edited by
      #2

      Happy new year to everybody! I did some researches and what I understand is that my app does not generates correctly the "MyProject.XmlSerializers.dll" ... Or else it uses another xmlserializer instead of this one. As said above my app is an Addon and is called from an outside application. This may confuse .NET and I found out that using the GAC may resolve the problem.... But I don't wanna do that. Any other suggestion would be appreciate!!!

      Life is not short... the problem is only how you organize yourself

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups