Hello,
How can we create a custom TransformerProvider (deriving from XmlSerializerTransformer with some minor changes) and make it work with the Enterprise Library Configuration Application Block?
Thank you!
Best wishes,
Alex.

Signature
Address email to user "response" at domain "alexoren" with suffix "com"
"Peter Huang" [MSFT] - 03 Sep 2005 04:29 GMT
Hi,
Currently I am researching the issue and we will reply here with more
information as soon as possible.
If you have any more concerns on it, please feel free to post here.
Thanks for your understanding!
Best regards,
Peter Huang
Microsoft Online Partner Support

Signature
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
[MSFT] - 05 Sep 2005 10:31 GMT
Hello Alex,
It is simple to create a custom TransformerProvider deriving from
XmlSerializerTransformer, you only need to override its methods properties,
like Deserialize, Serialize and ConfigurationName.
The tough one is to use it in Application blocks. To use your customized
XmlSerializerTransformer, you need to create your own
XmlSerializerTransformerData class or modify the source code of
XmlSerializerTransformerData.
The dataTransformer is set in app.config file:
<dataTransformer xsi:type="XmlSerializerTransformerData" name="Xml
Serializer Transformer">
<includeTypes />
</dataTransformer>
If you created customized XmlSerializerTransformerData, you should change
value here.
If you don't want to create a customized XmlSerializerTransformerData, you
can modify its source code so that it will load your own
XmlSerializerTransformer:
XmlSerializerTransformerData.cs:
[XmlIgnore]
public override string TypeName
{
get { return
typeof(XmlSerializerTransformer).AssemblyQualifiedName; }
set
{
}
}
Replace "XmlSerializerTransformer" with your own XmlSerializerTransformer
here.
Hope this help
Luke
Alex - 06 Sep 2005 15:56 GMT
Hello Luke,
Thank you for your suggestion.
We will try it and get back to you.
(I remember we tried something similar and had issues with the namespace)
Best wishes,
Alex.

Signature
Address email to user "response" at domain "alexoren" with suffix "com"
> Hello Alex,
>
[quoted text clipped - 39 lines]
>
> Luke
[MSFT] - 07 Sep 2005 06:39 GMT
Hi Alex,
Thank you for the update. If you have any related questions, please feel
free to post here.
Regards,
Luke
Alex - 15 Sep 2005 20:24 GMT
Hi Luke,
> Hi Alex,
>
> Thank you for the update. If you have any related questions, please feel
> free to post here.
We had a problem in deserializing the config file because it couldn't find our custom XmlSerializerTransformer
Do we need to change the following line?
<enterpriselibrary.configurationSettings
xmlns:xsd=http://www.w3.org/2001/XMLSchema
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
applicationName="MyApp"
xmlns="http://www.microsoft.com/practices/enterpriselibrary/08-31-2004/configuration">
Best wishes,
Alex.

Signature
Address email to user "response" at domain "alexoren" with suffix "com"
[MSFT] - 16 Sep 2005 07:18 GMT
Hi Alex,
They are schema definitions and will be used in the config file. I think we
don't need to change these lines.
Luke
Alex - 16 Sep 2005 20:59 GMT
> They are schema definitions and will be used in the config file. I think we
> don't need to change these lines.
What about the xmlns="http://www.microsoft.com/practices/enterpriselibrary/08-31-2004/configuration" part?
Best wishes,
Alex.

Signature
Address email to user "response" at domain "alexoren" with suffix "com"
[MSFT] - 21 Sep 2005 03:32 GMT
Hello Alex,
If we only want to create custom TransformerProvider, we don't need to
change this line too.
Luke
Mona - 07 Sep 2005 12:17 GMT
Hi Alex,
Regarding this issue, I would like to tell you that it is simple to create a
custom TransformerProvider deriving from XmlSerializerTransformer, you only
need to override its methods properties, like Deserialize, Serialize and
ConfigurationName. The tough one is to use it in Application blocks. To use
your customized XmlSerializerTransformer, you need to create your own
XmlSerializerTransformerData class or modify the source code of
XmlSerializerTransformerData. The dataTransformer is set in app.config file:
<dataTransformer xsi:type="XmlSerializerTransformerData" name="Xml
Serializer Transformer">
<includeTypes />
</dataTransformer>
If you created customized XmlSerializerTransformerData, you should change
value here.
If you don't want to create a customized XmlSerializerTransformerData, you
can modify its source code so that it will load your own.
XML SerializerTransformer:
XmlSerializerTransformerData.cs:
[XmlIgnore]
public override string TypeName
{
get { return
typeof(XmlSerializerTransformer).AssemblyQualifiedName; }
set
{
}
}
Replace " XmlSerializerTransformer " with your own XmlSerializerTransformer
here.
Hope this helps.
Best Regards,
Mona [Grapecity]
Hello,
How can we create a custom TransformerProvider (deriving from
XmlSerializerTransformer with some minor changes) and make it work with the
Enterprise Library Configuration Application Block?
Thank you!
Best wishes,
Alex.

Signature
Address email to user "response" at domain "alexoren" with suffix "com"