Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / September 2005

Tip: Looking for answers? Try searching our database.

Custom TransformerProvider in Configuration Application Block

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alex - 02 Sep 2005 19:43 GMT
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="XmlSerializerTransfo­rmerData" 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.c­s:

[XmlIgnore]
       public override string TypeName
       {
           get { return
typeof(XmlSerializerTransforme­r).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"


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.