This project is read-only.
2
Vote

The lack of Cassini support should be better handled or documented.

description

From the following thread in the discussions:
http://silk.codeplex.com/discussions/269886

At the very least this note in code should also be placed as part of the installation notes and also where the call hangs.
// Note: On a development server (Cassini) you may get a serializationexception
// with custom identities.  
//


For as much effort as went into this project, I don't understand why a workaround wasn't implemented.



System.InvalidOperationException was unhandled by user code
Message=There is an error in XML document (0, 0).
Source=System.Xml
StackTrace:
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   at System.Xml.Serialization.XmlSerializer.Deserialize(TextReader textReader)
   at MileageStats.Domain.Models.UserInfo.FromString(String userContextData) in C:\Users\SGM7\Documents\Silk\MileageStats\MileageStats.Domain\Models\UserInfo.cs:line 43
   at MileageStats.Web.Models.MileageStatsIdentity..ctor(FormsAuthenticationTicket ticket) in C:\Users\SGM7\Documents\Silk\MileageStats\MileageStats.Web\Models\MileageStatsIdentity.cs:line 46
   at MileageStats.Web.MvcApplication.PostAuthenticateRequestHandler(Object sender, EventArgs e) in C:\Users\SGM7\Documents\Silk\MileageStats\MileageStats.Web\Global.asax.cs:line 156
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
InnerException: System.Xml.XmlException
   Message=Root element is missing.
   Source=System.Xml
   LineNumber=0
   LinePosition=0
   SourceUri=""
   StackTrace:
        at System.Xml.XmlTextReaderImpl.Throw(Exception e)
        at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
        at System.Xml.XmlTextReaderImpl.Read()
        at System.Xml.XmlTextReader.Read()
        at System.Xml.XmlReader.MoveToContent()
        at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderUserInfo.Read3_UserInfo()
   InnerException: 

comments

aadami wrote Jan 17, 2012 at 8:45 PM

Hi,

This seems to be a known issue in Visual Studio, as mentioned in the aforementioned note (in MileageStatsIdentity.cs inside MileageStats RI): "On a development server (Cassini) you may get a serializationexception with custom identities.

More information can be found in the following link"

http://connect.microsoft.com/VisualStudio/feedback/details/274696/using-custom-identities-in-asp-net-fails-when-using-the-asp-net-developement-server

We are leaving this work item open so the team considers placing this note in the documentation.

Thanks,

Agustin Adami
http://blogs.southworks.net/aadami

etlds wrote Oct 31, 2012 at 4:40 PM

When I run at release mode. This error ran away. I don't know why...

ismarDude wrote Jan 24, 2013 at 6:18 AM

does not work with IIS Express either :-(

ismarDude wrote Jan 24, 2013 at 6:41 AM

in my case adding a generated machine Key to the config file helped (using http://aspnetresources.com/tools/machineKey tool)

something like

<machineKey validationKey="3B4630393E490E7D5F0CEDAFC832E6C75FD0F6A916C9D5C2E36244737795EC594F42DA5CAA6C38CBEBDB20E89FED067BC3D6812AA083B98A14286466451777C1" decryptionKey="A219CA4EF9495433CB43560685760EEA5879EC8C4161638DA923065801348B8B"
            validation="SHA1" decryption="AES" />