.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

SerializationException with CallContext

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :.NET Framework
Hi I have a Visual Studio Add-In written in C# that uses the CallContext object.  When Visual Studio starts a build of the opened solution, I get the following error: Unknown build error, 'Type is not resolved for member 'Codice.CM.Common.CmCallContext,commontypes, Version=, Culture=neutral, PublicKeyToken=a107c9c6e34c8876'.' The error occurs because Visual Studio launches the build process in a new AppDomain, and it needs to deserialize our CallContext (CmCallContext) object and it can't be load the commontypes.dll library because it is in other AppDomain (or dll is not registered in the GAC). So I have found some solutions but any is good for me: 1. Register commontypes.dll assembly in the GAC 2. Ensure that CallContext is clean before Visual Studio make anything (setting it to null). We tried to implement this solution but is quite difficult for us, because it implies clean callcontext after a server call, and we have a lot of server calls scattered throughout the code. We could centralize these calls, but it is very difficult because that would have a lot of delegates, and it would be very difficult to maintain. Somebody knows other workaround for this issue? Thanks in advanced,  Daniel

View Complete Post

More Related Resource Links

SerializationException using JSON Serializer

I'm getting a SerializationException with the following message when I deserialize a simple object serialized with JSON: Expecting element 'root' from namespace ''.. Encountered 'None'  with name '', namespace ''. Any ideas what's wrong?  Here is the code: namespace     JSONSerialization {     class Program { [   DataContract ]     public class Info { [   DataMember ]     public string version; }     static void Main( string [] args) {     Info apiInfo = new Info () {version = "1.0" };     MemoryStream stream1 = new MemoryStream ();     DataContractJsonSerializer ser = new DataContractJsonSerializer ( typeof ( Info )); ser.WriteObject(stream1, apiInfo   );     Info proxyReceived = ( Info )ser.ReadObject(stream1);     Console .WriteLine( string .Format( "{0}: {1}" , "API version" , proxyReceived.version)); } } }

SerializationException is catched when using native dll in ASP.NET

Hi expert,

There is a managed c++ project, which is used to wrapper one Native c++ project. And then I will use it in ASP.Net.

When I call the method of one ref class of  this managed C++ project, I will get the followed log in call stack.
  msvcm90d.dll!<CrtImplementationDetails>::GetDefaultDomain() Line 390 + 0x8 bytes C++
  msvcm90d.dll!<CrtImplementationDetails>::DoCallBackInDefaultDomain(int* function = 0x10F92EA0, bool cookie = false) Line 442 + 0x6 bytes C++
  msvcm90d.dll!<CrtImplementationDetails>::DefaultDomain::Initialize() Line 284 C++
  msvcm90d.dll!<CrtImplementationDetails>::LanguageSupport::InitializeDefaultAppDomain() Line 519 C++


And when call "MANAGED_ASSERT(pDomain->IsDefaultAppDomain(), "Expecting default appdomain")", I will get one error:
"An exception of type 'System.Runtime.Serialization.SerializationException' occurred in mscorlib.dll but was not handled in user code"

I try to research something for this kind of issue, and find there are some thoughts that this issue is caused by the difference of AppDomain used by ASP and the native dll--Asp.net runs on non-default Appdomain, but the native dll runs on defautl Appdomain
In order to verify it, I create a little example to test, and at an AppDomain check co

SerializationException on Geometry objects



I tried to serialize a bigger object with some Geometry objects:

This is the german error message ...

Eine nicht behandelte Ausnahme des Typs "System.Runtime.Serialization.SerializationException" ist in InkCanvas.exe aufgetreten.

=> unhandled SerializationException

Zusätzliche Informationen: Der Typ "System.Windows.Media.RectangleGeometry" in Assembly "PresentationCore, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" ist nicht als serialisierbar gekennzeichnet.

=> RectangleGeometry is marked as NonSerialized


Is there a change to get this objects serialized?



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend