Mono vs .NET System.Core.dll | "Could not load type of field 'Microsoft.Data.Tools.Schema.Common.Diagnostics.EtwProvider:m_provider'" - mono

While trying to use Mono on Linux, we are running into following exception and it is our understanding that the issue here is that System.Core.dll available with Mono (from The latest Stable Mono release 6.12.0) does not have this type implemented. As shown below, System.Core.dll available with .Net Framework 4.0 from my Windows Machine has this type. Since even the latest available release 6.12.0 doesn’t have this method implemented, we are not sure how to address this issue. Is there a way to get around this?
-Error-: exportLocalDbToBacpac failed with error [System.TypeInitializationException: The type initializer for 'Microsoft.SqlServer.Dac.DacServices' threw an exception. ---> System.TypeLoadException: Could not load type of field 'Microsoft.Data.Tools.Schema.Common.Diagnostics.EtwProvider:m_provider' (1) due to: Could not resolve type with token 01000013 from typeref (expected class 'System.Diagnostics.Eventing.EventProvider' in assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') assembly:System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 type:System.Diagnostics.Eventing.EventProvider member:(null)
at Microsoft.Data.Tools.Diagnostics.Tracer.TraceEvent (System.Diagnostics.TraceEventType eventType, Microsoft.Data.Tools.Diagnostics.TraceId traceId, System.String message) [0x0002e] in <23dd43cc13d44fc0a086e3dcc59d56fb>:0
at Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlSchemaModel.InitializeModelSchema () [0x00020] in <77e18559f1da49d98aba113ae5a8f9e1>:0
at Microsoft.SqlServer.Dac.DacServices.Initialize () [0x00000] in <2c61c847f6404054945b90f540b7b548>:0
at Microsoft.SqlServer.Dac.DacServices..cctor () [0x00000] in <2c61c847f6404054945b90f540b7b548>:0
--- End of inner exception stack trace ---
at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_generic_class_init(intptr)
at CvAzureSQL.AzureSQL.doExportLocalDbToBacpac (System.String exportFilePath, System.String sLocalFullServerName, System.String sDbName, System.Boolean bOverwriteExistingDb, System.Boolean& bIsCompatible) [0x00022] in :0
].
public bool doExportLocalDbToBacpac(string exportFilePath, string sLocalFullServerName, string sDbName, bool bOverwriteExistingDb, out bool bIsCompatible)
{
bIsCompatible = true;
try
{
bool ret = true;
string connectionString = "data source = " + sLocalFullServerName + "; Trusted_Connection=yes;";
**DacServices ds = new DacServices(connectionString);**
ds.ExportBacpac(exportFilePath, sDbName);
return ret;
}
catch (Exception e)
{
m_sErrorMsg += e.ToString();
m_sErrorMsg += "\n";
return false;
}
}
DotPeek tool showing details of System.Core.dll from .Net Framework
DotPeek tool showing details of mscorlib.dll available with Mono (from The latest Stable Mono release 6.12.0)

Related

ImageResizer AzureReader2 Plugin Nuget Error Out of the Box

I am getting an error when installing the ImageResizer AzureReader2 plugin. This is on a fresh install in an empty web project using Nuget to install the ImageResizer packages.
It is very similar to this issue here, but a binding redirect does not seem to fix the issue. I have also tried updating to 3.0 with the same issue.
Here is the stack :
Could not load file or assembly 'Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///c:/workspace/CC3.Images/CC3.Images/
LOG: Initial PrivatePath = c:\workspace\CC3.Images\CC3.Images\bin
Calling assembly : ImageResizer.Plugins.AzureReader2, Version=3.4.3.103, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: c:\workspace\CC3.Images\CC3.Images\web.config
LOG: Using host configuration file: C:\Users\steve.westner\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///C:/Users/steve.westner/AppData/Local/Temp/Temporary ASP.NET Files/root/ae2511c3/bb7d3a9/Microsoft.WindowsAzure.Configuration.DLL.
LOG: Attempting download of new URL file:///C:/Users/steve.westner/AppData/Local/Temp/Temporary ASP.NET Files/root/ae2511c3/bb7d3a9/Microsoft.WindowsAzure.Configuration/Microsoft.WindowsAzure.Configuration.DLL.
LOG: Attempting download of new URL file:///c:/workspace/CC3.Images/CC3.Images/bin/Microsoft.WindowsAzure.Configuration.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
Stack Trace:
[FileLoadException: Could not load file or assembly 'Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
ImageResizer.Plugins.AzureReader2.AzureVirtualPathProvider..ctor(String blobStorageConnection) +0
ImageResizer.Plugins.AzureReader2.AzureReader2Plugin.Install(Config c) +379
ImageResizer.Configuration.PluginConfig.add_plugin_by_name(String name, NameValueCollection args) +275
ImageResizer.Configuration.PluginConfig.loadPluginsInternal() +402
ImageResizer.Configuration.PluginConfig.LoadPlugins() +102
ImageResizer.Configuration.Config..ctor(ResizerSection config) +546
ImageResizer.Configuration.Config.get_Current() +115
ImageResizer.InterceptModule.get_conf() +36
ImageResizer.InterceptModule.System.Web.IHttpModule.Init(HttpApplication context) +250
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +418
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
[HttpException (0x80004005): Could not load file or assembly 'Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9931880
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34248
I resolved this issue by moving to ImageResizer version 4.0 stack, which at this time is in pre-release and was not showing in the package manager console.
The following command installed everything needed :
Install-Package ImageResizer.Plugins.AzureReader2 -Pre

Self-hosted WCF 4.5 WsHttpBinding -> 400 Bad Response

I'm self-hosting a WCF WSHttpBinding bound service. When running, I can't get any variation on the service call to work. Can you diagnose this problem?
A basic GET from the address bar (multiple browsers) fails with 400 Bad Request. So does $.ajax with GET, POST with 'dataType': 'json' or 'dataType': 'jsonp'. I've tried variations on the base address. Including or omitting the WebInvokeAttribute doesn't make a difference. Whether or not the HTTP Method is matched or mismatched doesn't make a difference.
Setting the service endpoint to a narrower path and then browsing to paths outside of that endpoint appropriately results in an error (about the method not being allowed). Using GET from ajax without jsonp will fail due to cross-site-scripting protections as expected but I can avoid that scenario.
(There are a million versions of this question online. Some seem resolved, but with answers that don't help. Others are unresolved. This is not an exact duplicate of any of them.)
The WCF trace invariably indicates: "There is a problem with the XML that was received from the network." with "The body of the message cannot be read because it is empty" as the inner exception - even for a GET request for which there should be no body (right?). Even if I attempt to POST with json data of '' or '{}', I get still this error exactly.
This code sample is mostly from: http://msdn.microsoft.com/en-us/library/ms730935.aspx, a .Net 4.5 WCF sample. The sample is bigger than necessary and I had to add binding.HostNameComparisonMode = HostNameComparisonMode.Exact; so that Windows would allow it to run without full admin rights. I also played with the relative url (now empty) to test.
Running this and pointing the browser to http://localhost:8000/ is properly serving the MEX/WSDL advertisement. This tells me that the webservice is running and that I am browsing to the right endpoint (plus or minus a service prefix, at least) and that Windows Firewall or permissions are not interfering with the process's ability to open or serve on a port. Yet http://localhost:8000/Ping just gets 400.
If I remember correctly (maybe not though), older versions of WCF and .NET didn't allow or didn't support self-hosted web-like protocols. I believe that's changed. Again, the serving of the MEX data isn't all that different from the custom stuff I want to serve - it's just coming from a different place in the same process.
sdb.IncludeExceptionDetailInFaults = true; seems to have no helpful effect here.
using System;
using System.Diagnostics;
using System.ServiceModel;
using System.ServiceModel.Description;
using System.ServiceModel.Web;
namespace WCFWebHost
{
static class Program
{
[STAThread]
static void Main(string[] args)
{
Uri baseAddress = new Uri("http://localhost:8000/");
ServiceHost selfHost = new ServiceHost(typeof(EchoService), baseAddress);
try
{
var binding = new WSHttpBinding();
binding.HostNameComparisonMode = HostNameComparisonMode.Exact;
selfHost.AddServiceEndpoint(typeof(IEcho), binding, "");
ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
selfHost.Description.Behaviors.Add(smb);
var sdb = selfHost.Description.Behaviors.Find<ServiceDebugBehavior>();
sdb.IncludeExceptionDetailInFaults = true;
selfHost.Open();
Console.WriteLine("Open and waiting.");
Console.ReadKey(true);
selfHost.Close();
}
catch (CommunicationException ce)
{
Console.WriteLine("An exception occurred: {0}", ce.Message);
selfHost.Abort();
}
}
}
[ServiceContract(Namespace = "http://echo")]
public interface IEcho
{
[OperationContract]
[WebInvoke(
Method = "GET",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.WrappedRequest,
UriTemplate = "Ping")]
void Ping();
}
public class EchoService : IEcho
{
public void Ping()
{
}
}
}
The web config has this traces.svc configuration added:
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="System.ServiceModel"
switchValue="Verbose, ActivityTracing"
propagateActivity="true">
<listeners>
<add name="traceListener"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="C:\Users\...\Traces.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>
===
Something that seems odd to me is that the traced exception seems to be coming from the error reporting itself. Is this error in the trace hiding better information about the original failure? Or am I just reading a re-throw wrong?
<Exception>
<ExceptionType>System.ServiceModel.ProtocolException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
<Message>There is a problem with the XML that was received from the network. See inner exception for more details.</Message>
<StackTrace>
at System.Runtime.Diagnostics.EtwDiagnosticTrace.WriteExceptionToTraceString(XmlTextWriter xml, Exception exception, Int32 remainingLength, Int32 remainingAllowedRecursionDepth)
at System.Runtime.Diagnostics.EtwDiagnosticTrace.ExceptionToTraceString(Exception exception, Int32 maxTraceStringLength)
at System.Runtime.Diagnostics.EtwDiagnosticTrace.GetSerializedPayload(Object source, TraceRecord traceRecord, Exception exception, Boolean getServiceReference)
at System.Runtime.TraceCore.ThrowingException(EtwDiagnosticTrace trace, String param0, String param1, Exception exception)
at System.Runtime.ExceptionTrace.TraceException[TException](TException exception, String eventSource)
at System.Runtime.ExceptionTrace.AsError(Exception exception)
at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.CompleteParseAndEnqueue(IAsyncResult result)
at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.HandleParseIncomingMessage(IAsyncResult result)
at System.Runtime.AsyncResult.SyncContinue(IAsyncResult result)
at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult..ctor(ReplyChannelAcceptor acceptor, Action dequeuedCallback, HttpPipeline pipeline, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.HttpPipeline.EmptyHttpPipeline.BeginProcessInboundRequest(ReplyChannelAcceptor replyChannelAcceptor, Action dequeuedCallback, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.HttpChannelListener`1.HttpContextReceivedAsyncResult`1.ProcessHttpContextAsync()
at System.ServiceModel.Channels.HttpChannelListener`1.BeginHttpContextReceived(HttpRequestContext context, Action acceptorCallback, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.SharedHttpTransportManager.EnqueueContext(IAsyncResult listenerContextResult)
at System.ServiceModel.Channels.SharedHttpTransportManager.OnGetContextCore(IAsyncResult listenerContextResult)
at System.ServiceModel.Channels.SharedHttpTransportManager.OnGetContext(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.ListenerAsyncResult.IOCompleted(ListenerAsyncResult asyncResult, UInt32 errorCode, UInt32 numBytes)
at System.Net.ListenerAsyncResult.WaitCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
</StackTrace>
<ExceptionString>System.ServiceModel.ProtocolException: There is a problem with the XML that was received from the network. See inner exception for more details. ---> System.Xml.XmlException: The body of the message cannot be read because it is empty.
--- End of inner exception stack trace ---</ExceptionString>
<InnerException>
<Exception>
<ExceptionType>System.Xml.XmlException, System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
<Message>The body of the message cannot be read because it is empty.</Message>
<StackTrace>
at System.Runtime.Diagnostics.EtwDiagnosticTrace.WriteExceptionToTraceString(XmlTextWriter xml, Exception exception, Int32 remainingLength, Int32 remainingAllowedRecursionDepth)
at System.Runtime.Diagnostics.EtwDiagnosticTrace.GetInnerException(Exception exception, Int32 remainingLength, Int32 remainingAllowedRecursionDepth)
at System.Runtime.Diagnostics.EtwDiagnosticTrace.WriteExceptionToTraceString(XmlTextWriter xml, Exception exception, Int32 remainingLength, Int32 remainingAllowedRecursionDepth)
at System.Runtime.Diagnostics.EtwDiagnosticTrace.ExceptionToTraceString(Exception exception, Int32 maxTraceStringLength)
at System.Runtime.Diagnostics.EtwDiagnosticTrace.GetSerializedPayload(Object source, TraceRecord traceRecord, Exception exception, Boolean getServiceReference)
at System.Runtime.TraceCore.ThrowingException(EtwDiagnosticTrace trace, String param0, String param1, Exception exception)
at System.Runtime.ExceptionTrace.TraceException[TException](TException exception, String eventSource)
at System.Runtime.ExceptionTrace.AsError(Exception exception)
at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.CompleteParseAndEnqueue(IAsyncResult result)
at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.HandleParseIncomingMessage(IAsyncResult result)
at System.Runtime.AsyncResult.SyncContinue(IAsyncResult result)
at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult..ctor(ReplyChannelAcceptor acceptor, Action dequeuedCallback, HttpPipeline pipeline, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.HttpPipeline.EmptyHttpPipeline.BeginProcessInboundRequest(ReplyChannelAcceptor replyChannelAcceptor, Action dequeuedCallback, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.HttpChannelListener`1.HttpContextReceivedAsyncResult`1.ProcessHttpContextAsync()
at System.ServiceModel.Channels.HttpChannelListener`1.BeginHttpContextReceived(HttpRequestContext context, Action acceptorCallback, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.SharedHttpTransportManager.EnqueueContext(IAsyncResult listenerContextResult)
at System.ServiceModel.Channels.SharedHttpTransportManager.OnGetContextCore(IAsyncResult listenerContextResult)
at System.ServiceModel.Channels.SharedHttpTransportManager.OnGetContext(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.ListenerAsyncResult.IOCompleted(ListenerAsyncResult asyncResult, UInt32 errorCode, UInt32 numBytes)
at System.Net.ListenerAsyncResult.WaitCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
</StackTrace>
<ExceptionString>System.Xml.XmlException: The body of the message cannot be read because it is empty.</ExceptionString>
</Exception>
</InnerException>
</Exception>
WSHttpBinding creates a soap based binding. You cannot access this endpoint using a browser by navigating to the URL. You can access this binding by creating a service proxy or using wcftestclient (for testing). If you are looking for developing a REST endpoint then use webHttpBinding instead of wsHttpBinding.
Here is a quick sample on how to develop REST based service. Here is a post which describes the differences between webHttpBinding & wsHttpBinding.
Call WCF Service exposed with WSHttp binding
web.config Settings
<services>
<service name="MyWcfService.MyService">
<endpoint address="jh" binding="wsHttpBinding" bindingConfiguration="NoSecurity" contract="MyWcfService.IMyService" />
</service>
</services>
html page
//SOAP request generated in order to call the Service method
var whRequest ="<s:Envelope xmlns:a=\"http://www.w3.org/2005/08/addressing\" xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\">" +
"<s:Header>" +
"<a:Action s:mustUnderstand=\"1\">http://tempuri.org/IMyService/GetData</a:Action>" +
"<a:MessageID>urn:uuid:7fdde7b6-64c8-4402-9af1-cc848f15888f</a:MessageID>" +
"<a:ReplyTo>" +
"<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>" +
"</a:ReplyTo>" +
"<a:To s:mustUnderstand=\"1\">http://localhost:1415/MyService.svc/jh</a:To>" +
"</s:Header>" +
"<s:Body>" +
"<GetData xmlns=\"http://tempuri.org/\">"+
"<value>9</value>"+
"</GetData>" +
"</s:Body>" +
"</s:Envelope>";
$(document).ready(function () {
$("#btnWCFWSHttp").click(function () {
$.ajax({
type: "POST",
url: "http://localhost:1415/MyService.svc/jh/",
data: whRequest,
timeout: 10000,
contentType: "application/soap+xml",
dataType: "xml",
async: false,
success: function (data, status, xhr) {
$(data).find("GetDataResponse").each(function () {
alert($(this).find("GetDataResult").text());
});
},
error: function (xhr, status, error) {
alert(error);
}
});
});
});

Unable to find assembly 'NHibernate.Search

I am getting the following error intermittently on one of our build environments (not on my local machine) - ignore the NH version - I compiled the assembly form source. The app pool is then restarted in iis. I cannot find out where this is originating from. Any ideas?
An unhandled exception occurred and the process was terminated.
Application ID: DefaultDomain
Process ID: 2428
Exception: System.Runtime.Serialization.SerializationException
Message: Unable to find assembly 'NHibernate.Search, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
StackTrace: at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.AppDomain.Deserialize(Byte[] blob)
at System.AppDomain.UnmarshalObject(Byte[] blob)

RavenDB client onlinux connecting to windows server using mono http

I've just tried connecting to my RavenDB windows instance from linux using mono. I'm getting a bizarre error with it, that seems to be mono related rather than raven related.
Here is my recreate code (works on windows):
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Raven.Client.Document;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
try
{
var store = new DocumentStore()
{
ConnectionStringName = "RavenDB",
EnlistInDistributedTransactions = false
};
store.Initialize();
using (var session = store.OpenSession("system-events"))
{
session.Store(new { Name = "Test" });
session.SaveChanges();
}
Console.WriteLine("done");
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
Console.ReadKey();
}
}
}
and my mono version:
chris#x-ngx4:~/click/beta/Debug$ mono --version
Mono JIT compiler version 2.10.8.1 (Debian 2.10.8.1-1ubuntu2.2)
Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: Included Boehm (with typed GC and Parallel Mark)
and the error:
chris#x-ngx4:~/click/beta/Debug$ mono ConsoleApplication2.exe
System.IO.IOException: Internal error (no progress possible) Flush
at System.IO.Compression.DeflateStream.CheckResult (Int32 result, System.String where) [0x00000] in <filename unknown>:0
at System.IO.Compression.DeflateStream.Flush () [0x00000] in <filename unknown>:0
at System.IO.Compression.GZipStream.Flush () [0x00000] in <filename unknown>:0
at Raven.Abstractions.Connection.HttpRequestHelper.WriteDataToRequest (System.Net.HttpWebRequest req, System.String data, Boolean disableCompression) [0x00000] in <filename unknown>:0
at Raven.Client.Connection.HttpJsonRequest.Write (System.String data) [0x00000] in <filename unknown>:0
at Raven.Client.Connection.ServerClient.DirectBatch (IEnumerable`1 commandDatas, System.String operationUrl) [0x00000] in <filename unknown>:0
at Raven.Client.Connection.ServerClient+<>c__DisplayClass68.<Batch>b__67 (System.String u) [0x00000] in <filename unknown>:0
at Raven.Client.Connection.ReplicationInformer.TryOperation[BatchResult[]] (System.Func`2 operation, System.String operationUrl, Boolean avoidThrowing, Raven.Abstractions.Data.BatchResult[]& result) [0x00000] in <filename unknown>:0
I think I found it. DeflateStream has extern references to zlib. If you look at the zlib header file, you will find some comments:
deflate() returns Z_OK if some progress has been made (more input
processed or more output produced), Z_STREAM_END if all input has been
consumed and all output has been produced (only when flush is set to
Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for
example if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress
is possible (for example avail_in or avail_out was zero). Note that
Z_BUF_ERROR is not fatal, and deflate() can be called again with more
input and more output space to continue compressing.
The message Internal error (no progress possible) is what DeflateStream returns when getting a Z_BUF_ERROR - but it doesn't continue, it treats it as a hard stop. It should treat it as a warning and continue. At least, that's my interpretation.
Can you raise this with the mono support team? I'm not active in that group. Thanks.

NHibernate Version Issue

I'm having a go at getting a test project up and running. I've nabbed a load of code from this article.....
Fluent NHibernate Automap with NHibernate Facility in ASP.NET MVC
Problem is that I'm getting the following error....
Could not load file or assembly 'NHibernate, Version=3.0.0.1001,
Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)
I've downloaded all the latest and greatest from NHibernate, Castle Project, and FluentNHibernate. I've looked at the version of the NHibernate.dll that I am referencing in the project and it's 3.0.0.400. Where and why is the solution complaining about 3.0.0.1001??????
For future use, I'd like to know how I find out what the problem is as well as the solution if possible.
Many thanks,
ETFairfax
MORE INFO.......
Exception Details: System.IO.FileLoadException: Could not load file or
assembly 'NHibernate, Version=3.0.0.1001, Culture=neutral,
PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The
located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040)
Source Error:
Line 45: if (container == null)
Line 46: {
Line 47: container = new WindsorContainer()
Line 48: .Install(
Line 49: Configuration.FromAppConfig(),
Source File: C:\Users\Public\Documents\TestCompany\Source\TestCompany.TestModule\MvcApplication2\Global.asax.cs Line: 47
Assembly Load Trace: The following information can be helpful to determine why the assembly 'NHibernate, Version=3.0.0.1001, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' could not be loaded.
=== Pre-bind state information ===
LOG: User = ETFairfax-TestCompany\ETFairfax
LOG: DisplayName = NHibernate, Version=3.0.0.1001, Culture=neutral, PublicKeyToken=aa95f207798dfdb4
(Fully-specified)
LOG: Appbase = file:///C:/Users/Public/Documents/TestCompany/Source/TestCompany.TestModule/MvcApplication2/
LOG: Initial PrivatePath = C:\Users\Public\Documents\TestCompany\Source\TestCompany.TestModule\MvcApplication2\bin
Calling assembly : ClassLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\Public\Documents\TestCompany\Source\TestCompany.TestModule\MvcApplication2\web.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: NHibernate, Version=3.0.0.1001, Culture=neutral, PublicKeyToken=aa95f207798dfdb4
LOG: Attempting download of new URL file:///C:/Users/ETFairfax/AppData/Local/Temp/Temporary ASP.NET Files/root/25bf06cc/f1f41498/NHibernate.DLL.
LOG: Attempting download of new URL file:///C:/Users/ETFairfax/AppData/Local/Temp/Temporary ASP.NET Files/root/25bf06cc/f1f41498/NHibernate/NHibernate.DLL.
LOG: Attempting download of new URL file:///C:/Users/Public/Documents/TestCompany/Source/TestCompany.TestModule/MvcApplication2/bin/NHibernate.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Revision Number
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
Stack Trace:
[FileLoadException: Could not load file or assembly 'NHibernate, Version=3.0.0.1001, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) +0
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +64
System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +58
System.Type.GetType(String typeName) +50
Castle.Facilities.NHibernateIntegration.NHibernateFacility.RegisterDefaultConfigurationBuilder() +133
Castle.Facilities.NHibernateIntegration.NHibernateFacility.RegisterComponents() +29
Castle.Facilities.NHibernateIntegration.NHibernateFacility.Init() +196
Castle.MicroKernel.Facilities.AbstractFacility.Init(IKernel kernel, IConfiguration facilityConfig) +61
Castle.MicroKernel.DefaultKernel.AddFacility(String key, IFacility facility) +182
Castle.Windsor.WindsorContainer.AddFacility(String key, IFacility facility) +49
Castle.Windsor.Installer.DefaultComponentInstaller.SetUpFacilities(IConfiguration[] configurations, IWindsorContainer container) +242
Castle.Windsor.Installer.DefaultComponentInstaller.SetUp(IWindsorContainer container, IConfigurationStore store) +89
Castle.Windsor.WindsorContainer.Install(IWindsorInstaller[] installers) +268
MvcApplication2.MvcApplication.InitializeWindsor() in C:\Users\Public\Documents\TestCompany\Source\TestCompany.TestModule\MvcApplication2\Global.asax.cs:47
MvcApplication2.MvcApplication.Application_Start() in C:\Users\Public\Documents\TestCompany\Source\TestCompany.TestModule\MvcApplication2\Global.asax.cs:62
Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4955
Fluent was probably built with a later version than the NHibernate asselbly you downloaded.
Theres a bundle of Fluent/NH3.0 at Fluent NHibernate website.
http://fluentnhibernate.org/downloads