Click here to Skip to main content
15,886,919 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: How to Set the Window Class Name of a Windows Form App? Pin
Matt Gerrans16-Jun-04 10:18
Matt Gerrans16-Jun-04 10:18 
GeneralRe: How to Set the Window Class Name of a Windows Form App? Pin
Heath Stewart16-Jun-04 10:21
protectorHeath Stewart16-Jun-04 10:21 
GeneralWindows service problem accessing network share Pin
Member 116497710-Jun-04 6:03
Member 116497710-Jun-04 6:03 
GeneralRe: Windows service problem accessing network share Pin
Heath Stewart13-Jun-04 19:39
protectorHeath Stewart13-Jun-04 19:39 
Generallocalizing bitmaps Pin
klawipo10-Jun-04 1:42
klawipo10-Jun-04 1:42 
GeneralRe: localizing bitmaps Pin
Heath Stewart13-Jun-04 19:36
protectorHeath Stewart13-Jun-04 19:36 
GeneralProblem with serializing objects Pin
Marco M.9-Jun-04 23:02
Marco M.9-Jun-04 23:02 
GeneralRe: Problem with serializing objects Pin
Vega0210-Jun-04 17:36
Vega0210-Jun-04 17:36 
I had a similar problem in the project I'm working on now. You need to ensure that the type that is being serialized exists in both assemblies. For example, say that you have the following setup:

ASSEMBLY 1:
- Module1.cs

ASSEMBLY 2:
- Module2.cs

And assume that each of those files has the code for some class Foo in it. Even if the code for Foo is byte-for-byte the same in both files, the framework will throw an error when attempting to deserialize because it's trying to instantiate the assembly in which the object was first created. The important fact here is that it's extremely difficult to separate a class from its containing assembly.

The solution that I ended up implementing:

ASSEMBLY 1:
- Module1.cs
- References [ASSEMBLY FOO]

ASSEMBLY 2:
- Module2.cs
- References [ASSEMBLY FOO]

ASSEMBLY FOO:
- Foo.cs

Here, simply remove the code for Foo from Module1.cs and Module2.cs, putting it into Foo.cs in a different assembly instead. If you reference ASSEMBLY FOO from both modules, the framework will now correctly locate the required assembly and deserialize the class.

There may in fact be an alternative method to implementing this, but this is the most straightforward method that I know of. It's also the one that worked for my project. Smile | :)
QuestionHow to obtain appconfig file name Pin
peshkov9-Jun-04 22:19
peshkov9-Jun-04 22:19 
AnswerRe: How to obtain appconfig file name Pin
Heath Stewart13-Jun-04 19:51
protectorHeath Stewart13-Jun-04 19:51 
Generaldynamic loading Pin
ting6689-Jun-04 16:13
ting6689-Jun-04 16:13 
GeneralRe: dynamic loading Pin
Richard Jones7-Jul-04 2:57
Richard Jones7-Jul-04 2:57 
GeneralSaving image as JPEG - best possible quality Pin
michalJ9-Jun-04 11:42
michalJ9-Jun-04 11:42 
Generalregasm fails, cannot load type Pin
Steven Campbell9-Jun-04 6:25
Steven Campbell9-Jun-04 6:25 
GeneralRe: regasm fails, cannot load type Pin
klawipo10-Jun-04 1:30
klawipo10-Jun-04 1:30 
GeneralRe: regasm fails, cannot load type Pin
Steven Campbell10-Jun-04 4:39
Steven Campbell10-Jun-04 4:39 
GeneralGeneral purpose high score Web Service Pin
Jonas Follesø7-Jun-04 22:03
Jonas Follesø7-Jun-04 22:03 
GeneralProblems with CallContext Pin
itechx7-Jun-04 21:19
itechx7-Jun-04 21:19 
GeneralRegistering File Types Pin
bneacetp7-Jun-04 16:21
bneacetp7-Jun-04 16:21 
GeneralRe: Registering File Types Pin
Aryadip8-Jun-04 18:19
Aryadip8-Jun-04 18:19 
GeneralRe: Registering File Types Pin
bneacetp8-Jun-04 19:10
bneacetp8-Jun-04 19:10 
GeneralRe: Registering File Types Pin
Heath Stewart13-Jun-04 19:12
protectorHeath Stewart13-Jun-04 19:12 
GeneralRe: Registering File Types Pin
bneacetp15-Jun-04 12:40
bneacetp15-Jun-04 12:40 
GeneralDynamically Naming PCL Files Pin
BongX7-Jun-04 8:15
BongX7-Jun-04 8:15 
GeneralHelp i'm lost Pin
neurorebel6-Jun-04 21:52
neurorebel6-Jun-04 21:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.