not serializable .. Errormessage

Thebest

Member
Joined
Dec 13, 2005
Messages
11
Programming Experience
1-3
Hello,

I'm developping a project in VB.NET and I included a C# class library in the same project.

The program is working but before I start debugging/running the project I get the following errormessage in Visual Studio 2005.

Error.JPG


Any idea what it means?

Greetz,

Thebest
 
Hey I'm not yet running VS2005. Hope to be soon.

However, according to your message. Maybe all you have to do is add the <Serializable> attribute to the CalendarLibrary.CalendarItem method or property. Hey just an educated guess.

From everything I have read in VS2005 you should be able to add a C# and VB.net class files to your project. Maybe it's the way you added the C# project to your Solution(???).

Do you have two projects in one solution? Your text indicates you have add a class library so how did you add code to refer to this library? Did you add a reference and an imports statement then instantiate your C# object? Did you set your VB.net project as the start up project?

Things to think about...
 
Merchand said:
Hey I'm not yet running VS2005. Hope to be soon.

However, according to your message. Maybe all you have to do is add the <Serializable> attribute to the CalendarLibrary.CalendarItem method or property. Hey just an educated guess.

From everything I have read in VS2005 you should be able to add a C# and VB.net class files to your project. Maybe it's the way you added the C# project to your Solution(???).

Do you have two projects in one solution? Your text indicates you have add a class library so how did you add code to refer to this library? Did you add a reference and an imports statement then instantiate your C# object? Did you set your VB.net project as the start up project?

Things to think about...

Idd, just added
[
Serializable] and
using
System.Runtime.Serialization; and it works fine now.

How a stupid thing can cause a "difficult" errormessage :)

Tx anyway!
 
Did you add this attribute to a class or a method?
 
VB.NET:
[SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][SIZE=2] System;
[/SIZE][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][SIZE=2] System.Collections.Generic;
[/SIZE][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][SIZE=2] System.Text;
[/SIZE][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][SIZE=2] System.Runtime.Serialization;
[/SIZE][SIZE=2][COLOR=#0000ff]namespace[/COLOR][/SIZE][SIZE=2] CalendarLibrary
{
[[/SIZE][SIZE=2][COLOR=#008080]Serializable[/COLOR][/SIZE][SIZE=2]]
[/SIZE][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]class[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#008080]CalendarItem
[/COLOR][/SIZE][SIZE=2]{
[/SIZE][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#008080]DateTime[/COLOR][/SIZE][SIZE=2] m_startTime = [/SIZE][SIZE=2][COLOR=#008080]DateTime[/COLOR][/SIZE][SIZE=2].MinValue;
[/SIZE][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#008080]DateTime[/COLOR][/SIZE][SIZE=2] m_endTime = [/SIZE][SIZE=2][COLOR=#008080]DateTime[/COLOR][/SIZE][SIZE=2].MinValue;
[/SIZE][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][SIZE=2] m_description = [/SIZE][SIZE=2][COLOR=#008080]String[/COLOR][/SIZE][SIZE=2].Empty;
[/SIZE][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]bool[/COLOR][/SIZE][SIZE=2] m_isTentative = [/SIZE][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][SIZE=2];
[/SIZE][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][SIZE=2] CalendarItem([/SIZE][SIZE=2][COLOR=#008080]DateTime[/COLOR][/SIZE][SIZE=2] startTime, [/SIZE][SIZE=2][COLOR=#008080]DateTime[/COLOR][/SIZE][SIZE=2] endTime, [/SIZE][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][SIZE=2] description, [/SIZE][SIZE=2][COLOR=#0000ff]bool[/COLOR][/SIZE][SIZE=2] isTentative)
{
m_startTime = startTime;
m_endTime = endTime;
m_description = description;
m_isTentative = isTentative;
}
[/SIZE][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#008080]DateTime[/COLOR][/SIZE][SIZE=2] StartTime
{
[/SIZE][SIZE=2][COLOR=#0000ff]get
[/COLOR][/SIZE][SIZE=2]{
[/SIZE][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][SIZE=2] m_startTime;
}
[/SIZE][SIZE=2][COLOR=#0000ff]set
[/COLOR][/SIZE][SIZE=2]{
m_startTime = [/SIZE][SIZE=2][COLOR=#0000ff]value[/COLOR][/SIZE][SIZE=2];
}
}
[/SIZE][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#008080]DateTime[/COLOR][/SIZE][SIZE=2] EndTime
{
[/SIZE][SIZE=2][COLOR=#0000ff]get
[/COLOR][/SIZE][SIZE=2]{
[/SIZE][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][SIZE=2] m_endTime;
}
[/SIZE][SIZE=2][COLOR=#0000ff]set
[/COLOR][/SIZE][SIZE=2]{
m_endTime = [/SIZE][SIZE=2][COLOR=#0000ff]value[/COLOR][/SIZE][SIZE=2];
}
}
[/SIZE][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][SIZE=2] Description
{
[/SIZE][SIZE=2][COLOR=#0000ff]get
[/COLOR][/SIZE][SIZE=2]{
[/SIZE][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][SIZE=2] m_description;
}
[/SIZE][SIZE=2][COLOR=#0000ff]set
[/COLOR][/SIZE][SIZE=2]{
m_description = [/SIZE][SIZE=2][COLOR=#0000ff]value[/COLOR][/SIZE][SIZE=2];
}
}
[/SIZE][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]bool[/COLOR][/SIZE][SIZE=2] IsTentative
{
[/SIZE][SIZE=2][COLOR=#0000ff]get
[/COLOR][/SIZE][SIZE=2]{
[/SIZE][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][SIZE=2] m_isTentative;
}
[/SIZE][SIZE=2][COLOR=#0000ff]set
[/COLOR][/SIZE][SIZE=2]{
m_isTentative = [/SIZE][SIZE=2][COLOR=#0000ff]value[/COLOR][/SIZE][SIZE=2];
}
}
}
}
[/SIZE]
 
TheBest, I'm a newbie to this forum so how did you add your code sample to this post with a blue background?
 
Back
Top