Showing posts with label contains. Show all posts
Showing posts with label contains. Show all posts

Saturday, March 31, 2012

Separated DLLs for user controls

Hi,

By default VS.NET generates just one DLL contains all code behinds and
userconrols.
Is it possible to have VS.NET partitione them in their own assemblies for
granular security?

Thanks,
AliYes, you can do it a few ways

1. grab the control inside the current project and compile it using the
command line compiler, specifying the \out parameter
2. Create the control in its own project then reference it back into the
original project

"A.M" <IHateSpam@.sapm123.com> wrote in message
news:%23w0S0kZ9DHA.2524@.TK2MSFTNGP11.phx.gbl...
> Hi,
> By default VS.NET generates just one DLL contains all code behinds and
> userconrols.
> Is it possible to have VS.NET partitione them in their own assemblies for
> granular security?
> Thanks,
> Ali
I think 1 project = 1 DLL. Place them in separate projects if you want
multiple dll's.

"A.M" <IHateSpam@.sapm123.com> wrote in message
news:%23w0S0kZ9DHA.2524@.TK2MSFTNGP11.phx.gbl...
> Hi,
> By default VS.NET generates just one DLL contains all code behinds and
> userconrols.
> Is it possible to have VS.NET partitione them in their own assemblies for
> granular security?
> Thanks,
> Ali
Hi Ali,

Thanks for posting in the community!
Based on my understanding, you're wondering whether its ok to make all the
compoenent classes such as page class , usercontrol classes and other
components classes separately in different dll assemblies and which are
used in the same web application , yes?

I've review the other messages and I think A Lonely Programmer has provided
the informative suggestion, you can manually compile some of the components
classes in different dlls or even make some certain separate projects for
each dll. Then reference them in the main ASP.NET web application project.
For example:
Project A:
make page classes in dllA

ProjectB:
make Control classes in dllB

ProjectC
make other non-UI components in dllC

Main ASP.NET Project?
add all the above assebmlies as referenced and use
the classes in them.

How do you think so. Please check out those suggestions, if you have any
further questions, please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Thursday, March 29, 2012

Separated DLLs for user controls

Hi,

By default VS.NET generates just one DLL contains all code behinds and
userconrols.
Is it possible to have VS.NET partitione them in their own assemblies for
granular security?

Thanks,
AliYes, you can do it a few ways

1. grab the control inside the current project and compile it using the
command line compiler, specifying the \out parameter
2. Create the control in its own project then reference it back into the
original project

"A.M" <IHateSpam@.sapm123.com> wrote in message
news:%23w0S0kZ9DHA.2524@.TK2MSFTNGP11.phx.gbl...
> Hi,
> By default VS.NET generates just one DLL contains all code behinds and
> userconrols.
> Is it possible to have VS.NET partitione them in their own assemblies for
> granular security?
> Thanks,
> Ali
I think 1 project = 1 DLL. Place them in separate projects if you want
multiple dll's.

"A.M" <IHateSpam@.sapm123.com> wrote in message
news:%23w0S0kZ9DHA.2524@.TK2MSFTNGP11.phx.gbl...
> Hi,
> By default VS.NET generates just one DLL contains all code behinds and
> userconrols.
> Is it possible to have VS.NET partitione them in their own assemblies for
> granular security?
> Thanks,
> Ali
Hi Ali,

Thanks for posting in the community!
Based on my understanding, you're wondering whether its ok to make all the
compoenent classes such as page class , usercontrol classes and other
components classes separately in different dll assemblies and which are
used in the same web application , yes?

I've review the other messages and I think A Lonely Programmer has provided
the informative suggestion, you can manually compile some of the components
classes in different dlls or even make some certain separate projects for
each dll. Then reference them in the main ASP.NET web application project.
For example:
Project A:
make page classes in dllA

ProjectB:
make Control classes in dllB

ProjectC
make other non-UI components in dllC

Main ASP.NET Project?
add all the above assebmlies as referenced and use
the classes in them.

How do you think so. Please check out those suggestions, if you have any
further questions, please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Saturday, March 24, 2012

Serialization Question

Hi,
I have a collection class called Printers that implement the ICollection and
IEnumerable. This class contains a private ArrayList that holds the Printer
objects. The printer class is a serializable class that contains only the
public name attribute.
After serialization, I want to get the following xml structure;
<Printers>
<Printer>
<Name></Name>
</Printer>
<Printers>
When I want to serialize this Printers collection, I get instead something
like;
<ArrayOfPrinter>
<Printer>
<Name></Name>
</Printer>
</ArrayOfPrinter>
If I take out the ICollection and IEnumerable away, (turning the class into
a normal one) and make the ArrayList public, then I get the following;
<Printers>
<NameOfMyArrayList>
<Printer>
<Name></Name>
</Printer>
</NameOfMyArrayList>
</Printers>
For clarity, I don't include any code at the moment.
Any help appreciated,
EthemHello Ethem,
I'm assuming you mean XmlSerialization... Given that, either the XmlRoot
(if its the top level node) or XmlElement attributes will work.
[XmlRoot("Printers")]
public class PrinterCollection
{
// rest of your code
}
Matt Berther
http://www.mattberther.com

> Hi,
> I have a collection class called Printers that implement the
> ICollection and IEnumerable. This class contains a private ArrayList
> that holds the Printer objects. The printer class is a serializable
> class that contains only the public name attribute.
> After serialization, I want to get the following xml structure;
> <Printers>
> <Printer>
> <Name></Name>
> </Printer>
> <Printers>
> When I want to serialize this Printers collection, I get instead
> something like;
> <ArrayOfPrinter>
> <Printer>
> <Name></Name>
> </Printer>
> </ArrayOfPrinter>
> If I take out the ICollection and IEnumerable away, (turning the class
> into a normal one) and make the ArrayList public, then I get the
> following;
> <Printers>
> <NameOfMyArrayList>
> <Printer>
> <Name></Name>
> </Printer>
> </NameOfMyArrayList>
> </Printers>
> For clarity, I don't include any code at the moment.
> Any help appreciated,
> Ethem
>
Hi Matt,
Thanks for the response. Unfortunately, my collection class implements
ICollection and IEnumerable. If the collection implements these interfaces,
you cannot define an XmlRoot attribute (or any other attribute) on the class
level. Same applies if you derive the collection class from the
CollectionBase.
For my problem, I found a workaround in the following site:
http://dotnet.org.za/armand/archive...09/21/4164.aspx
It seems that you can make it programmatically instead of decleratively.
Thanks,
Ethem
"Matt Berther" wrote:

> Hello Ethem,
> I'm assuming you mean XmlSerialization... Given that, either the XmlRoot
> (if its the top level node) or XmlElement attributes will work.
> [XmlRoot("Printers")]
> public class PrinterCollection
> {
> // rest of your code
> }
> --
> Matt Berther
> http://www.mattberther.com
>
>
>

Serialization Question

Hi,

I have a collection class called Printers that implement the ICollection and
IEnumerable. This class contains a private ArrayList that holds the Printer
objects. The printer class is a serializable class that contains only the
public name attribute.

After serialization, I want to get the following xml structure;

<Printers>
<Printer>
<Name></Name>
</Printer>
<Printers
When I want to serialize this Printers collection, I get instead something
like;

<ArrayOfPrinter>
<Printer>
<Name></Name>
</Printer>
</ArrayOfPrinter
If I take out the ICollection and IEnumerable away, (turning the class into
a normal one) and make the ArrayList public, then I get the following;

<Printers>
<NameOfMyArrayList>
<Printer>
<Name></Name>
</Printer>
</NameOfMyArrayList>
</Printers
For clarity, I don't include any code at the moment.

Any help appreciated,

EthemHello Ethem,

I'm assuming you mean XmlSerialization... Given that, either the XmlRoot
(if its the top level node) or XmlElement attributes will work.

[XmlRoot("Printers")]
public class PrinterCollection
{
// rest of your code
}

--
Matt Berther
http://www.mattberther.com

> Hi,
> I have a collection class called Printers that implement the
> ICollection and IEnumerable. This class contains a private ArrayList
> that holds the Printer objects. The printer class is a serializable
> class that contains only the public name attribute.
> After serialization, I want to get the following xml structure;
> <Printers>
> <Printer>
> <Name></Name>
> </Printer>
> <Printers>
> When I want to serialize this Printers collection, I get instead
> something like;
> <ArrayOfPrinter>
> <Printer>
> <Name></Name>
> </Printer>
> </ArrayOfPrinter>
> If I take out the ICollection and IEnumerable away, (turning the class
> into a normal one) and make the ArrayList public, then I get the
> following;
> <Printers>
> <NameOfMyArrayList>
> <Printer>
> <Name></Name>
> </Printer>
> </NameOfMyArrayList>
> </Printers>
> For clarity, I don't include any code at the moment.
> Any help appreciated,
> Ethem
Hi Matt,

Thanks for the response. Unfortunately, my collection class implements
ICollection and IEnumerable. If the collection implements these interfaces,
you cannot define an XmlRoot attribute (or any other attribute) on the class
level. Same applies if you derive the collection class from the
CollectionBase.

For my problem, I found a workaround in the following site:

http://dotnet.org.za/armand/archive...09/21/4164.aspx

It seems that you can make it programmatically instead of decleratively.

Thanks,

Ethem

"Matt Berther" wrote:

> Hello Ethem,
> I'm assuming you mean XmlSerialization... Given that, either the XmlRoot
> (if its the top level node) or XmlElement attributes will work.
> [XmlRoot("Printers")]
> public class PrinterCollection
> {
> // rest of your code
> }
> --
> Matt Berther
> http://www.mattberther.com
> > Hi,
> > I have a collection class called Printers that implement the
> > ICollection and IEnumerable. This class contains a private ArrayList
> > that holds the Printer objects. The printer class is a serializable
> > class that contains only the public name attribute.
> > After serialization, I want to get the following xml structure;
> > <Printers>
> > <Printer>
> > <Name></Name>
> > </Printer>
> > <Printers>
> > When I want to serialize this Printers collection, I get instead
> > something like;
> > <ArrayOfPrinter>
> > <Printer>
> > <Name></Name>
> > </Printer>
> > </ArrayOfPrinter>
> > If I take out the ICollection and IEnumerable away, (turning the class
> > into a normal one) and make the ArrayList public, then I get the
> > following;
> > <Printers>
> > <NameOfMyArrayList>
> > <Printer>
> > <Name></Name>
> > </Printer>
> > </NameOfMyArrayList>
> > </Printers>
> > For clarity, I don't include any code at the moment.
> > Any help appreciated,
> > Ethem
>

Serializing between two projects

Hello All:

Say I have a solution with two projects (Project1 and Project2) and each
project contains a class (Project1 contains Class1 and Project2 contains
Class2).

The projects don't reference each other. Here's my question: can I
serialize Class1 and use the serialized XML in Class2? How would Class2
de-serialize the XML to retrieve the Class1's properties? I don't see how I
can do this since Project2 doesn't even know about Class1.

The example in MSDN (the Purchase Order Example) shows how to do this but
with classes in the same project. I want to do it with classes in different
projects.

TIA,
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA AutomationSo long as both classes have the same name and the same public
interface, sure. It should deserialize just fine.

What happened when you tried?

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/

--
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/
Jason,

Thanks for writing.

Class1 and Class2 are not the same class. Class2 uses Class1's properties.
For example, Class2 could have a method call where is needs some information
stored in Class1, i.e.

Sub Method2(TextValue as String, SomeClass1Value as Class1.Property1)

'Do something using the Class1's Property1...

End Sub

I need to pass the information contained in Class1 in Project1 to a method
in Class2 in Project2. I can't allow Project2 to reference Project1.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation

"Jason Kester" wrote:

> So long as both classes have the same name and the same public
> interface, sure. It should deserialize just fine.
> What happened when you tried?
> Jason Kester
> Expat Software Consulting Services
> http://www.expatsoftware.com/
> --
> Get your own Travel Blog, with itinerary maps and photos!
> http://www.blogabond.com/
>
write your own serializer.

-- bruce (sqlwork.com)

"Joe" <joeherro@.donotspam.yahoo.com> wrote in message
news:DC2EFF4E-2F7E-4689-9223-D0A7B2AF3143@.microsoft.com...
> Hello All:
> Say I have a solution with two projects (Project1 and Project2) and each
> project contains a class (Project1 contains Class1 and Project2 contains
> Class2).
> The projects don't reference each other. Here's my question: can I
> serialize Class1 and use the serialized XML in Class2? How would Class2
> de-serialize the XML to retrieve the Class1's properties? I don't see how
> I
> can do this since Project2 doesn't even know about Class1.
> The example in MSDN (the Purchase Order Example) shows how to do this but
> with classes in the same project. I want to do it with classes in
> different
> projects.
> TIA,
> --
> Joe
> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
How. I've never done this.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation

"Bruce Barker" wrote:

> write your own serializer.
> -- bruce (sqlwork.com)
>
> "Joe" <joeherro@.donotspam.yahoo.com> wrote in message
> news:DC2EFF4E-2F7E-4689-9223-D0A7B2AF3143@.microsoft.com...
> > Hello All:
> > Say I have a solution with two projects (Project1 and Project2) and each
> > project contains a class (Project1 contains Class1 and Project2 contains
> > Class2).
> > The projects don't reference each other. Here's my question: can I
> > serialize Class1 and use the serialized XML in Class2? How would Class2
> > de-serialize the XML to retrieve the Class1's properties? I don't see how
> > I
> > can do this since Project2 doesn't even know about Class1.
> > The example in MSDN (the Purchase Order Example) shows how to do this but
> > with classes in the same project. I want to do it with classes in
> > different
> > projects.
> > TIA,
> > --
> > Joe
> > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>
Take a look at the sample I posted in reply to the other thread you started.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.

"Joe" <joeherro@.donotspam.yahoo.com> wrote in message
news:C2005721-C6D0-4A96-AD10-25E8F75D7DF0@.microsoft.com...
> How. I've never done this.
> --
> Joe
> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>
> "Bruce Barker" wrote:
>> write your own serializer.
>>
>> -- bruce (sqlwork.com)
>>
>>
>> "Joe" <joeherro@.donotspam.yahoo.com> wrote in message
>> news:DC2EFF4E-2F7E-4689-9223-D0A7B2AF3143@.microsoft.com...
>> > Hello All:
>>> > Say I have a solution with two projects (Project1 and Project2) and
>> > each
>> > project contains a class (Project1 contains Class1 and Project2
>> > contains
>> > Class2).
>>> > The projects don't reference each other. Here's my question: can I
>> > serialize Class1 and use the serialized XML in Class2? How would
>> > Class2
>> > de-serialize the XML to retrieve the Class1's properties? I don't see
>> > how
>> > I
>> > can do this since Project2 doesn't even know about Class1.
>>> > The example in MSDN (the Purchase Order Example) shows how to do this
>> > but
>> > with classes in the same project. I want to do it with classes in
>> > different
>> > projects.
>>> > TIA,
>> > --
>> > Joe
>>> > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>>
>>
>
Kevin,

Thanks. How would you handle this: DailyReport serializes its data to a
file (or memory stream or whatever). Now, another class (let's call this
class MonthlyReport) - in a different project - wants to de-serialize
DailyReport's data so that it can use it. Assume that MonthlyReport does not
have the same methods, properties, events, etc as DailyReport. How would
you create the XmlSerializer in the Deserializer method in MonthlyReport? Is
this even possible since it has different properties, methods, etc than
DailyReport?

I know how to do this when the class that performs the serialization and
de-serialization is the same class; I'm wondering if it can be done when the
class that serializes is different from the class that de-serializes.

Thanks for all of your help.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation

"Kevin Spencer" wrote:

> Take a look at the sample I posted in reply to the other thread you started.
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
> Complex things are made up of
> Lots of simple things.
> "Joe" <joeherro@.donotspam.yahoo.com> wrote in message
> news:C2005721-C6D0-4A96-AD10-25E8F75D7DF0@.microsoft.com...
> > How. I've never done this.
> > --
> > Joe
> > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
> > "Bruce Barker" wrote:
> >> write your own serializer.
> >>
> >> -- bruce (sqlwork.com)
> >>
> >>
> >> "Joe" <joeherro@.donotspam.yahoo.com> wrote in message
> >> news:DC2EFF4E-2F7E-4689-9223-D0A7B2AF3143@.microsoft.com...
> >> > Hello All:
> >> >> > Say I have a solution with two projects (Project1 and Project2) and
> >> > each
> >> > project contains a class (Project1 contains Class1 and Project2
> >> > contains
> >> > Class2).
> >> >> > The projects don't reference each other. Here's my question: can I
> >> > serialize Class1 and use the serialized XML in Class2? How would
> >> > Class2
> >> > de-serialize the XML to retrieve the Class1's properties? I don't see
> >> > how
> >> > I
> >> > can do this since Project2 doesn't even know about Class1.
> >> >> > The example in MSDN (the Purchase Order Example) shows how to do this
> >> > but
> >> > with classes in the same project. I want to do it with classes in
> >> > different
> >> > projects.
> >> >> > TIA,
> >> > --
> >> > Joe
> >> >> > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
> >>
> >>
> >>
>
Hi Joe,

I can see where this is heading. Read the following articles and references:

http://msdn.microsoft.com/library/d...rialization.asp
http://msdn.microsoft.com/library/d...lasstopic .asp

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.

"Joe" <joeherro@.donotspam.yahoo.com> wrote in message
news:8D2595AF-7D74-4575-8179-BF00494AB219@.microsoft.com...
> Kevin,
> Thanks. How would you handle this: DailyReport serializes its data to a
> file (or memory stream or whatever). Now, another class (let's call this
> class MonthlyReport) - in a different project - wants to de-serialize
> DailyReport's data so that it can use it. Assume that MonthlyReport does
> not
> have the same methods, properties, events, etc as DailyReport. How would
> you create the XmlSerializer in the Deserializer method in MonthlyReport?
> Is
> this even possible since it has different properties, methods, etc than
> DailyReport?
> I know how to do this when the class that performs the serialization and
> de-serialization is the same class; I'm wondering if it can be done when
> the
> class that serializes is different from the class that de-serializes.
> Thanks for all of your help.
> --
> Joe
> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>
> "Kevin Spencer" wrote:
>> Take a look at the sample I posted in reply to the other thread you
>> started.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> ..Net Developer
>> Complex things are made up of
>> Lots of simple things.
>>
>> "Joe" <joeherro@.donotspam.yahoo.com> wrote in message
>> news:C2005721-C6D0-4A96-AD10-25E8F75D7DF0@.microsoft.com...
>> > How. I've never done this.
>> > --
>> > Joe
>>> > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>>>> > "Bruce Barker" wrote:
>>> >> write your own serializer.
>> >>
>> >> -- bruce (sqlwork.com)
>> >>
>> >>
>> >> "Joe" <joeherro@.donotspam.yahoo.com> wrote in message
>> >> news:DC2EFF4E-2F7E-4689-9223-D0A7B2AF3143@.microsoft.com...
>> >> > Hello All:
>> >>> >> > Say I have a solution with two projects (Project1 and Project2) and
>> >> > each
>> >> > project contains a class (Project1 contains Class1 and Project2
>> >> > contains
>> >> > Class2).
>> >>> >> > The projects don't reference each other. Here's my question: can I
>> >> > serialize Class1 and use the serialized XML in Class2? How would
>> >> > Class2
>> >> > de-serialize the XML to retrieve the Class1's properties? I don't
>> >> > see
>> >> > how
>> >> > I
>> >> > can do this since Project2 doesn't even know about Class1.
>> >>> >> > The example in MSDN (the Purchase Order Example) shows how to do
>> >> > this
>> >> > but
>> >> > with classes in the same project. I want to do it with classes in
>> >> > different
>> >> > projects.
>> >>> >> > TIA,
>> >> > --
>> >> > Joe
>> >>> >> > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>> >>
>> >>
>> >>
>>
>>
>
Hi Kevin,

Thanks. I've already read these. The examples that they give are for
classes that all exist in the same project. I am asking about serializing a
class in one project and de-serializing it in another project.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation

"Kevin Spencer" wrote:

> Hi Joe,
> I can see where this is heading. Read the following articles and references:
> http://msdn.microsoft.com/library/d...rialization.asp
> http://msdn.microsoft.com/library/d...lasstopic .asp
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
> Complex things are made up of
> Lots of simple things.
> "Joe" <joeherro@.donotspam.yahoo.com> wrote in message
> news:8D2595AF-7D74-4575-8179-BF00494AB219@.microsoft.com...
> > Kevin,
> > Thanks. How would you handle this: DailyReport serializes its data to a
> > file (or memory stream or whatever). Now, another class (let's call this
> > class MonthlyReport) - in a different project - wants to de-serialize
> > DailyReport's data so that it can use it. Assume that MonthlyReport does
> > not
> > have the same methods, properties, events, etc as DailyReport. How would
> > you create the XmlSerializer in the Deserializer method in MonthlyReport?
> > Is
> > this even possible since it has different properties, methods, etc than
> > DailyReport?
> > I know how to do this when the class that performs the serialization and
> > de-serialization is the same class; I'm wondering if it can be done when
> > the
> > class that serializes is different from the class that de-serializes.
> > Thanks for all of your help.
> > --
> > Joe
> > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
> > "Kevin Spencer" wrote:
> >> Take a look at the sample I posted in reply to the other thread you
> >> started.
> >>
> >> --
> >> HTH,
> >>
> >> Kevin Spencer
> >> Microsoft MVP
> >> ..Net Developer
> >> Complex things are made up of
> >> Lots of simple things.
> >>
> >> "Joe" <joeherro@.donotspam.yahoo.com> wrote in message
> >> news:C2005721-C6D0-4A96-AD10-25E8F75D7DF0@.microsoft.com...
> >> > How. I've never done this.
> >> > --
> >> > Joe
> >> >> > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
> >> >> >> > "Bruce Barker" wrote:
> >> >> >> write your own serializer.
> >> >>
> >> >> -- bruce (sqlwork.com)
> >> >>
> >> >>
> >> >> "Joe" <joeherro@.donotspam.yahoo.com> wrote in message
> >> >> news:DC2EFF4E-2F7E-4689-9223-D0A7B2AF3143@.microsoft.com...
> >> >> > Hello All:
> >> >> >> >> > Say I have a solution with two projects (Project1 and Project2) and
> >> >> > each
> >> >> > project contains a class (Project1 contains Class1 and Project2
> >> >> > contains
> >> >> > Class2).
> >> >> >> >> > The projects don't reference each other. Here's my question: can I
> >> >> > serialize Class1 and use the serialized XML in Class2? How would
> >> >> > Class2
> >> >> > de-serialize the XML to retrieve the Class1's properties? I don't
> >> >> > see
> >> >> > how
> >> >> > I
> >> >> > can do this since Project2 doesn't even know about Class1.
> >> >> >> >> > The example in MSDN (the Purchase Order Example) shows how to do
> >> >> > this
> >> >> > but
> >> >> > with classes in the same project. I want to do it with classes in
> >> >> > different
> >> >> > projects.
> >> >> >> >> > TIA,
> >> >> > --
> >> >> > Joe
> >> >> >> >> > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>

Serializing between two projects

Hello All:
Say I have a solution with two projects (Project1 and Project2) and each
project contains a class (Project1 contains Class1 and Project2 contains
Class2).
The projects don't reference each other. Here's my question: can I
serialize Class1 and use the serialized XML in Class2? How would Class2
de-serialize the XML to retrieve the Class1's properties? I don't see how I
can do this since Project2 doesn't even know about Class1.
The example in MSDN (the Purchase Order Example) shows how to do this but
with classes in the same project. I want to do it with classes in different
projects.
TIA,
--
Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA AutomationSo long as both classes have the same name and the same public
interface, sure. It should deserialize just fine.
What happened when you tried?
Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/
Jason,
Thanks for writing.
Class1 and Class2 are not the same class. Class2 uses Class1's properties.
For example, Class2 could have a method call where is needs some information
stored in Class1, i.e.
Sub Method2(TextValue as String, SomeClass1Value as Class1.Property1)
'Do something using the Class1's Property1...
End Sub
I need to pass the information contained in Class1 in Project1 to a method
in Class2 in Project2. I can't allow Project2 to reference Project1.
--
Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Jason Kester" wrote:

> So long as both classes have the same name and the same public
> interface, sure. It should deserialize just fine.
> What happened when you tried?
> Jason Kester
> Expat Software Consulting Services
> http://www.expatsoftware.com/
> --
> Get your own Travel Blog, with itinerary maps and photos!
> http://www.blogabond.com/
>
write your own serializer.
-- bruce (sqlwork.com)
"Joe" <joeherro@.donotspam.yahoo.com> wrote in message
news:DC2EFF4E-2F7E-4689-9223-D0A7B2AF3143@.microsoft.com...
> Hello All:
> Say I have a solution with two projects (Project1 and Project2) and each
> project contains a class (Project1 contains Class1 and Project2 contains
> Class2).
> The projects don't reference each other. Here's my question: can I
> serialize Class1 and use the serialized XML in Class2? How would Class2
> de-serialize the XML to retrieve the Class1's properties? I don't see how
> I
> can do this since Project2 doesn't even know about Class1.
> The example in MSDN (the Purchase Order Example) shows how to do this but
> with classes in the same project. I want to do it with classes in
> different
> projects.
> TIA,
> --
> Joe
> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
How. I've never done this.
--
Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Bruce Barker" wrote:

> write your own serializer.
> -- bruce (sqlwork.com)
>
> "Joe" <joeherro@.donotspam.yahoo.com> wrote in message
> news:DC2EFF4E-2F7E-4689-9223-D0A7B2AF3143@.microsoft.com...
>
>
Take a look at the sample I posted in reply to the other thread you started.
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Complex things are made up of
Lots of simple things.
"Joe" <joeherro@.donotspam.yahoo.com> wrote in message
news:C2005721-C6D0-4A96-AD10-25E8F75D7DF0@.microsoft.com...
> How. I've never done this.
> --
> Joe
> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>
> "Bruce Barker" wrote:
>
Kevin,
Thanks. How would you handle this: DailyReport serializes its data to a
file (or memory stream or whatever). Now, another class (let's call this
class MonthlyReport) - in a different project - wants to de-serialize
DailyReport's data so that it can use it. Assume that MonthlyReport does no
t
have the same methods, properties, events, etc as DailyReport. How would
you create the XmlSerializer in the Deserializer method in MonthlyReport? I
s
this even possible since it has different properties, methods, etc than
DailyReport?
I know how to do this when the class that performs the serialization and
de-serialization is the same class; I'm wondering if it can be done when the
class that serializes is different from the class that de-serializes.
Thanks for all of your help.
--
Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Kevin Spencer" wrote:

> Take a look at the sample I posted in reply to the other thread you starte
d.
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
> Complex things are made up of
> Lots of simple things.
> "Joe" <joeherro@.donotspam.yahoo.com> wrote in message
> news:C2005721-C6D0-4A96-AD10-25E8F75D7DF0@.microsoft.com...
>
>
Hi Joe,
I can see where this is heading. Read the following articles and references:
http://msdn.microsoft.com/library/d...rialization.asp
http://msdn.microsoft.com/library/d...
opic.asp
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Complex things are made up of
Lots of simple things.
"Joe" <joeherro@.donotspam.yahoo.com> wrote in message
news:8D2595AF-7D74-4575-8179-BF00494AB219@.microsoft.com...
> Kevin,
> Thanks. How would you handle this: DailyReport serializes its data to a
> file (or memory stream or whatever). Now, another class (let's call this
> class MonthlyReport) - in a different project - wants to de-serialize
> DailyReport's data so that it can use it. Assume that MonthlyReport does
> not
> have the same methods, properties, events, etc as DailyReport. How would
> you create the XmlSerializer in the Deserializer method in MonthlyReport?
> Is
> this even possible since it has different properties, methods, etc than
> DailyReport?
> I know how to do this when the class that performs the serialization and
> de-serialization is the same class; I'm wondering if it can be done when
> the
> class that serializes is different from the class that de-serializes.
> Thanks for all of your help.
> --
> Joe
> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>
> "Kevin Spencer" wrote:
>
Hi Kevin,
Thanks. I've already read these. The examples that they give are for
classes that all exist in the same project. I am asking about serializing a
class in one project and de-serializing it in another project.
--
Joe
VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Kevin Spencer" wrote:

> Hi Joe,
> I can see where this is heading. Read the following articles and reference
s:
> http://msdn.microsoft.com/library/d...rialization.asp
> http://msdn.microsoft.com/library/d...r />
stopic.asp
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
> Complex things are made up of
> Lots of simple things.
> "Joe" <joeherro@.donotspam.yahoo.com> wrote in message
> news:8D2595AF-7D74-4575-8179-BF00494AB219@.microsoft.com...
>
>