9.16.2009

Dealing With XMLSerializer

The error caught was:

File or assembly name yofdjhlq.dll, or one of its dependencies, was not found.
at SerializationClass.ToXml() in d:\nur\work\iataadapter\serialization.cs:line
20
at IATAAdapter.IATAAdapter.Main(String[] args) in d:\nur\work\iataadapter\iat
aadapter.cs:line 25

What to do? another class that I tried to serialize has no problem. Got hint from 2 days googling for this problem. I add this line in app.config.







Then tried to run the application again. Write the name of the missing assembly and find it in the temp folder that the Visual Studio used to store its temporary assembly. At first I search it in wrong folder, which is C:\Windows\Temp. Well all of them in the asp.net forum make me concentrate on that folder, including granting the security for ASPNET user account as well. It turn out that the temporary assembly is stored in C:\Documents and Settings\[logged_user]\Local Settings\Temp. The result of adding the lines in app.config finally paid off. I found the [assembly_name].0.cs file and [assembly_name].out file which shows the actual error. In my case, this is it says:

error CS0030: Cannot convert type 'InvoiceTransmissionInvoiceSubInvoiceHeaderInvoiceLineSubItemSubItemProduct[]' to 'InvoiceTransmissionInvoiceSubInvoiceHeaderInvoiceLineSubItemSubItemProduct'
error CS0029: Cannot implicitly convert type 'InvoiceTransmissionInvoiceSubInvoiceHeaderInvoiceLineSubItemSubItemProduct' to 'InvoiceTransmissionInvoiceSubInvoiceHeaderInvoiceLineSubItemSubItemProduct[]'

The end of this story is a happy end. Finally found the mishaps in the class I tried to serialize and the XML Serializer is working just amazing.

0 comments:

 
Template by yummylolly.com