Databases have "Recovery Pending" status every few hours - asp.net

I recently noticed that most of the databases on my SQL Server are getting the Recovery Pending status after running for a few hours (sometimes 6, sometimes more). I can't imagine this being the expected outcome, so I decided to post about it here.
I opened the Event Log viewer and decided to find some more info about what's going on. It seems that all my databases are "Starting up" every few minutes or so (as cam be seen here). Some of them get started multiple times in a row. Is that supposed to work like that?
After scrolling a bit more, I found this warning from one of my IIS websites:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 4/11/2018 9:32:05 AM
Event time (UTC): 4/11/2018 7:32:05 AM
Event ID: 7911bb726cd34d36941e8232ad78b059
Event sequence: 18
Event occurrence: 3
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/5/ROOT-1-131679051910980983
Trust level: Full
Application Virtual Path: /
Application Path: C:\inetpub\x\
Machine name: WIN-IV6CMBTUQ4N
Process information:
Process ID: 2400
Process name: w3wp.exe
Account name: IIS APPPOOL\x
Exception information:
Exception type: HttpException
Exception message: The remote host closed the connection. The error code is 0x80070057.
at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)
at System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()
at System.Web.HttpResponse.Flush(Boolean finalFlush, Boolean async)
at System.Web.HttpWriter.WriteFromStream(Byte[] data, Int32 offset, Int32 size)
at Microsoft.Owin.Host.SystemWeb.CallStreams.OutputStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at Microsoft.AspNet.SignalR.Owin.ServerResponse.Write(ArraySegment`1 data)
at Microsoft.AspNet.SignalR.Hosting.ResponseExtensions.End(IResponse response, String data)
at Microsoft.AspNet.SignalR.TaskAsyncHelper.TaskRunners`2.<>c__DisplayClass2_0.<RunTask>b__0(Task t)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Owin.Mapping.MapMiddleware.<Invoke>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.StageAsyncResult.End(IAsyncResult ar)
at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Request information:
Request URL: http://91.134.116.40:8003/signalr/start?clientProtocol=1.4&transport=webSockets&connectionData=[{"Name":"ChatHub"}]&connectionToken=/y39a+1XOv/u7X/ZFYw5ACLQu58FVNl0hbkMwPHCw1EQ9gdCbpFxPQzPuJVDxRywoP2AaI6akuXxQIxM2Wwa0OLO4cWd/e3csUBetjb9nROsisQnavw52ulTHWVOjK/j&user=User-14D
Request path: /signalr/start
User host address: 24.13.101.142
User:
Is authenticated: False
Authentication Type:
Thread account name: IIS APPPOOL\x
Thread information:
Thread ID: 14
Thread account name: IIS APPPOOL\x
Is impersonating: False
Stack trace: at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)
at System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()
at System.Web.HttpResponse.Flush(Boolean finalFlush, Boolean async)
at System.Web.HttpWriter.WriteFromStream(Byte[] data, Int32 offset, Int32 size)
at Microsoft.Owin.Host.SystemWeb.CallStreams.OutputStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at Microsoft.AspNet.SignalR.Owin.ServerResponse.Write(ArraySegment`1 data)
at Microsoft.AspNet.SignalR.Hosting.ResponseExtensions.End(IResponse response, String data)
at Microsoft.AspNet.SignalR.TaskAsyncHelper.TaskRunners`2.<>c__DisplayClass2_0.<RunTask>b__0(Task t)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Owin.Mapping.MapMiddleware.<Invoke>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.StageAsyncResult.End(IAsyncResult ar)
at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Custom event details:
Seems like there's something wrong with SignalR, so it shouldn't have any direct relation with the database, but there aren't any other errors/warnings there.
Am I missing something here?
Thank you!

Do you have "auto close" enabled on the database?
Best practice is to have it OFF
ALTER DATABASE <mydb> SET AUTO_CLOSE OFF
I would also check AUTO_SHRINK while I was there

Related

MongoDB atlas connection not working from within a docker container running ASP.net core. Works fine from inside kestrel

We have asp.net core based docker containers trying to connect to MongoDB atlas with the C# driver version 2.4.3.
The connection is working fine for when we run it outside the container. i.e. directly from kestrel. But when the same code is run from within a container, the connection to mongodb atlas times out.
Details:
MongoDB C# Driver version: 2.4.3
Connection String:
mongodb://sa:#cluster0-shard-00-00-po5vp.mongodb.net:27017,cluster0-shard-00-01-po5vp.mongodb.net:27017,cluster0-shard-00-02-po5vp.mongodb.net:27017/admin?ssl=true&replicaSet=Cluster0-shard-0&authSource=admin
Database to be accessed: Configurations
ASP.net Core version: 1.1
BaseImage in Dockerfile: microsoft/aspnetcore-build
Dockerfile contents:
FROM microsoft/aspnetcore-build
WORKDIR /SaaS_Configuration_Microservice
COPY ./SaaS_Configuration_Microservice .
EXPOSE 80
RUN dotnet restore
RUN dotnet publish -c Release -o PublishOutput
ENTRYPOINT ["dotnet", "PublishOutput/SaaS_Configuration_Microservice.dll"]
We are running kestrel in Windows 10.
Complete Error Message:
ex.Message "A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = ReadPreferenceServerSelector{ ReadPreference = { Mode : Primary } }, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster state is { ClusterId : \"1\", ConnectionMode : \"ReplicaSet\", Type : \"ReplicaSet\", State : \"Disconnected\", Servers : [{ ServerId: \"{ ClusterId : 1, EndPoint : \"Unspecified/cluster0-shard-00-00-po5vp.mongodb.net:27017\" }\", EndPoint: \"Unspecified/cluster0-shard-00-00-po5vp.mongodb.net:27017\", State: \"Disconnected\", Type: \"Unknown\", HeartbeatException: \"MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server. ---> MongoDB.Driver.MongoCommandException: Command failed.\n at MongoDB.Driver.Core.WireProtocol.CommandWireProtocol1.ProcessReply(ConnectionId connectionId, ReplyMessage1 reply)\n at MongoDB.Driver.Core.WireProtocol.CommandWireProtocol1.<ExecuteAsync>d__11.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n at MongoDB.Driver.Core.Connections.ConnectionInitializer.<InitializeConnectionAsync>d__3.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n at MongoDB.Driver.Core.Connections.BinaryConnection.<OpenHelperAsync>d__48.MoveNext()\n --- End of inner exception stack trace ---\n at MongoDB.Driver.Core.Connections.BinaryConnection.<OpenHelperAsync>d__48.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n at MongoDB.Driver.Core.Servers.ServerMonitor.<HeartbeatAsync>d__27.MoveNext()\" }, { ServerId: \"{ ClusterId : 1, EndPoint : \"Unspecified/cluster0-shard-00-01-po5vp.mongodb.net:27017\" }\", EndPoint: \"Unspecified/cluster0-shard-00-01-po5vp.mongodb.net:27017\", State: \"Disconnected\", Type: \"Unknown\", HeartbeatException: \"MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server. ---> MongoDB.Driver.MongoCommandException: Command failed.\n at MongoDB.Driver.Core.WireProtocol.CommandWireProtocol1.ProcessReply(ConnectionId connectionId, ReplyMessage1 reply)\n at MongoDB.Driver.Core.WireProtocol.CommandWireProtocol1.d__11.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n at MongoDB.Driver.Core.Connections.ConnectionInitializer.d__3.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n at MongoDB.Driver.Core.Connections.BinaryConnection.d__48.MoveNext()\n --- End of inner exception stack trace ---\n at MongoDB.Driver.Core.Connections.BinaryConnection.d__48.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n at MongoDB.Driver.Core.Servers.ServerMonitor.d__27.MoveNext()\" }, { ServerId: \"{ ClusterId : 1, EndPoint : \"Unspecified/cluster0-shard-00-02-po5vp.mongodb.net:27017\" }\", EndPoint: \"Unspecified/cluster0-shard-00-02-po5vp.mongodb.net:27017\", State: \"Disconnected\", Type: \"Unknown\", HeartbeatException: \"MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server. ---> MongoDB.Driver.MongoCommandException: Command failed.\n at MongoDB.Driver.Core.WireProtocol.CommandWireProtocol1.ProcessReply(ConnectionId connectionId, ReplyMessage1 reply)\n at MongoDB.Driver.Core.WireProtocol.CommandWireProtocol`1.d__11.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n at MongoDB.Driver.Core.Connections.ConnectionInitializer.d__3.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n at MongoDB.Driver.Core.Connections.BinaryConnection.d__48.MoveNext()\n --- End of inner exception stack trace ---\n at MongoDB.Driver.Core.Connections.BinaryConnection.d__48.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n at MongoDB.Driver.Core.Servers.ServerMonitor.d__27.MoveNext()\" }] }." string
Inner exception: null
"microsoft/aspnetcore-build" is a Linux image and there is a bug:
https://docs.atlas.mongodb.com/driver-connection/#c-net-driver-example
IMPORTANT The .NET Core library does not support the SNI TLS extension
on Linux and OSX. Applications using .NET Core on these operating
systems cannot connect to a Atlas Free Tier cluster.
The issue is tracked on the dotnet/corefx github page.

Asp Net Core on Ubuntu - access is denied

After installing library MailKit and calling new SmtpClient().ConnectAsync(_settings.Server, _settings.Port, _settings.SSL); I get this error:
Access to the path '/var/www/.dotnet/corefx/cryptography/crls' is denied.
by the way, my project is located on /media/ProjectName.
i tried perform this: sudo chmod -R 755 /var but i got permission error.
here is stacktrace:
at System.IO.UnixFileSystem.CreateDirectory(String fullPath)↵ at System.IO.Directory.CreateDirectory(String path)↵ at Internal.Cryptography.Pal.CrlCache.GetCachedCrlPath(X509Certificate2 cert, Boolean mkDir)↵ at Internal.Cryptography.Pal.CrlCache.DownloadAndAddCrl(X509Certificate2 cert, SafeX509StoreHandle store, TimeSpan& remainingDownloadTime)↵ at Internal.Cryptography.Pal.CrlCache.AddCrlForCertificate(X509Certificate2 cert, SafeX509StoreHandle store, X509RevocationMode revocationMode, DateTime verificationTime, TimeSpan& remainingDownloadTime)↵ at Internal.Cryptography.Pal.OpenSslX509ChainProcessor.BuildChain(X509Certificate2 leaf, HashSet1 candidates, HashSet1 downloaded, HashSet1 systemTrusted, OidCollection applicationPolicy, OidCollection certificatePolicy, X509RevocationMode revocationMode, X509RevocationFlag revocationFlag, DateTime verificationTime, TimeSpan& remainingDownloadTime)↵ at Internal.Cryptography.Pal.ChainPal.BuildChain(Boolean useMachineContext, ICertificatePal cert, X509Certificate2Collection extraStore, OidCollection applicationPolicy, OidCollection certificatePolicy, X509RevocationMode revocationMode, X509RevocationFlag revocationFlag, DateTime verificationTime, TimeSpan timeout)↵ at System.Security.Cryptography.X509Certificates.X509Chain.Build(X509Certificate2 certificate)↵ at System.Net.Security.CertificateValidation.BuildChainAndVerifyProperties(X509Chain chain, X509Certificate2 remoteCertificate, Boolean checkCertName, String hostName)↵ at System.Net.Security.SecureChannel.VerifyRemoteCertificate(RemoteCertValidationCallback remoteCertValidationCallback)↵ at System.Net.Security.SslState.CompleteHandshake()↵ at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)↵ at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)↵ at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)↵ at System.Net.Security.SslState.ReadFrameCallback(AsyncProtocolRequest asyncRequest)↵--- End of stack trace from previous location where exception was thrown ---↵ at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()↵ at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)↵ at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)↵ at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)↵ at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task`1 promise, Boolean requiresSynchronization)↵--- End of stack trace from previous location where exception was thrown ---↵ at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)↵ at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)↵ at MailKit.Net.Smtp.SmtpClient.Connect(String host, Int32 port, SecureSocketOptions options, CancellationToken cancellationToken)↵ at MailKit.MailService.<>c__DisplayClass41_0.b__0()↵ at System.Threading.Tasks.Task.Execute()↵--- End of stack trace from previous location where exception was thrown ---↵ at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)↵ at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)↵ at MyProject.Services.MessageService.d__4.MoveNext()↵--- End of stack trace from previous location where exception was thrown ---↵ at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)↵ at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)↵ at MyProject.Services.MessageService.d__5.MoveNext()
As Lex Li posted create directory /var/www/.dotnet/corefx/cryptography/crls and give rights to www-data group (if this is the group that runs your service)
sudo chgrp www-data /var/www/.dotnet/corefx/cryptography/crls
I was referring this guide. In the kestrel-hellomvc.service file replaced User=www-data with User=my-root-username and it worked.
Hope it helps someone.

How can I specify the ASP.NET probing path for automatic C++/CLI appdomains?

I have a C++/CLI DLL that needs to run in the context of an ASP.NET WebApi action.
The action is affected by an ActionFilter that uses log4net's LogicalThreadContext to set a property containing a request ID; this works nicely to write the request ID into the log entries.
The problem is that ASP.NET seems to be creating an appdomain when it's time to load the class from the C++/CLI dll. (I can't seem to find any documentation on how that works; I'd love to find some.) When the appdomain plumbing tries to deserialize everything, it chokes because it can't find log4net.dll (see stack trace below).
Fusion logs show that it's looking in C:\Windows\System32\inetsrv, which is incorrect... I would expect it to look in the probing path or along the %PATH% environment variable.
A few data points:
log4net.dll is available in the web app's bin directory and works fine for everything else I'm using it for.
The C++/CLI code has no dependencies on log4net.
If I comment out my calls to log4net.LogicalThreadContext.Properties[...], everything works fine.
If I copy log4net.dll from my bin folder to C:\Windows\system32\inetsrv, everything works fine.
The web.config file specifies the probing path with a <probing privatePath="bin"/> element.
My Application_Start method in global.asax.cs prepends the web app's bin directory to the %PATH% environment variable:
var currentPathEnvVar = Environment.GetEnvironmentVariable("PATH");
var binPath = Path.Combine(Server.MapPath("~") ?? String.Empty, "bin");
_log.DebugFormat("Prepending paths to PATH: [{0}]", binPath);
Environment.SetEnvironmentVariable("PATH", String.Concat(binPath, Path.PathSeparator, currentPathEnvVar));
The log shows that the %PATH% is getting prepended correctly:
2015-06-05 17:07:48,816 1 DEBUG MyNamespace.WebApiApplication (null) Prepending paths to PATH: [C:\Program Files\MyCompany\MyApp\web\bin]
So how do I get the appdomain that ASP.NET creates to look in the right place to load assemblies?
Thanks.
Here's the stack trace that gets logged when all this goes down.
2015-06-05 17:08:41,148 23 ERROR MyNamespace.MyController (null) Controller action failed
System.TypeInitializationException: The type initializer for '<Module>' threw an exception. ---> <CrtImplementationDetails>.ModuleLoadException: The C++ module failed to load while attempting to initialize the default appdomain.
---> System.Runtime.Serialization.SerializationException: Unable to find assembly 'log4net, Version=1.2.13.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
Server stack trace:
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.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
at System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage.FixupForNewAppDomain()
at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(Byte[] reqStmBuff, SmuggledMethodCallMessage smuggledMcm, SmuggledMethodReturnMessage& smuggledMrm)
at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(Object[] args)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.AppDomain.IsDefaultAppDomain()
at <CrtImplementationDetails>.GetDefaultDomain() in f:\dd\vctools\crt\crtw32\h\minternal.h:line 367
at <CrtImplementationDetails>.DoCallBackInDefaultDomain(IntPtr function, Void* cookie) in f:\dd\vctools\crt\crtw32\h\minternal.h:line 401
at <CrtImplementationDetails>.DefaultDomain.Initialize() in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 278
at <CrtImplementationDetails>.LanguageSupport.InitializeDefaultAppDomain(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 343
at <CrtImplementationDetails>.LanguageSupport._Initialize(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 546
at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 703
--- End of inner exception stack trace ---
at <CrtImplementationDetails>.ThrowModuleLoadException(String errorMessage, Exception innerException) in f:\dd\vctools\crt\crtw32\h\minternal.h:line 194
at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 713
at .cctor() in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 754
--- End of inner exception stack trace ---
at MyNamespace.MyController.MyAction(String foo, Int64 bar, String baz)
This helped me to resolve similar issue:
https://blogs.msdn.microsoft.com/jorman/2007/08/31/loading-c-assemblies-in-asp-net/
Faced option 2.a and proposed solution worked fine:
protected void Application_Start(object sender, EventArgs e){
String _path = String.Concat(System.Environment.GetEnvironmentVariable("PATH"), ";",
System.AppDomain.CurrentDomain.RelativeSearchPath);
System.Environment.SetEnvironmentVariable("PATH", _path, EnvironmentVariableTarget.Process); }

Error using SignalR utility Crank.exe

I'm using crank to load test my signalr application. The command that I'm using is as follows
crank /NumClients:100 /Url:http://localhost:29573/TestConnection /BatchSize:10
I'm getting an exception in my powershell window as follows...
Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object
reference not set to an instance of an object.
at Microsoft.AspNet.SignalR.Client.HubConnection.GetUrl(String url, Boolean useDefaultUrl) in c:\Users\t-niraj\Deskto
p\SignalR-master\src\Microsoft.AspNet.SignalR.Client\HubConnection.cs:line 216
at Microsoft.AspNet.SignalR.Client.HubConnection..ctor(String url, Boolean useDefaultUrl) in c:\Users\t-niraj\Desktop
\SignalR-master\src\Microsoft.AspNet.SignalR.Client\HubConnection.cs:line 38
at Microsoft.AspNet.SignalR.Client.HubConnection..ctor(String url) in c:\Users\t-niraj\Desktop\SignalR-master\src\Mic
rosoft.AspNet.SignalR.Client\HubConnection.cs:line 28
at Microsoft.AspNet.SignalR.Crank.Client.<OpenControllerConnection>d__6.MoveNext() in c:\Users\t-niraj\Desktop\Signal
R-master\src\Microsoft.AspNet.SignalR.Crank\Client.cs:line 71
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNet.SignalR.Crank.Client.<Run>d__0.MoveNext() in c:\Users\t-niraj\Desktop\SignalR-master\src\Microsof
t.AspNet.SignalR.Crank\Client.cs:line 43
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at Microsoft.AspNet.SignalR.Crank.Client.Main() in c:\Users\t-niraj\Desktop\SignalR-master\src\Microsoft.AspNet.Signa
lR.Crank\Client.cs:line 34
I do have the sample application: SignalR.LoadTestHarness running at localhost:29573. This is the same application that is found in the SignalR source code samples.
What am I doing wrong?
You did not provide the ControllerUrl parameter and as a result crank is trying to create a hub connection with null Url which results in throwing a NullReferenceException on this line.

Biztalk Error in WCF OracleDBBinding

I used the Consume Adapter Service to create the OrcaleDBBinding to access 3 views from DB. When I tried to test the project I am getting error like,
The adapter failed to transmit message going to send port "XYZ_DEF_WcfSendPort_OracleDBBinding_Multiple_Custom" with URL "oracledb://abcd.def/". It will be retransmitted after the retry interval specified for this Send Port.
Details:"Microsoft.ServiceModel.Channels.Common.MetadataException: Argument
<BtsActionMapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Operation Name="Select1" Action="http://Microsoft.LobServices.OracleDB/View/EMPEXPORT/Select" />
<Operation Name="Select2" Action="http://Microsoft.LobServices.OracleDB/View/JOBEXPORT/Select" />
<Operation Name="Select3" Action="http://Microsoft.LobServices.OracleDB/View/POSITIONEXPORT/Select" />
</BtsActionMapping> is invalid.
Server stack trace:
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.ServiceModel.Channels.IRequestChannel.EndRequest(IAsyncResult result)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)".
In the oracleDBbinding I even changed the following property
"enableBizTalkCompatibilityMode" = True
"useAmbientTransaction" = False
But getting the same error.Can anybody help me, why am I getting this error. Thanks.
The Problem was because I changed the operations in the Logical Ports,which was different from Select. When I changed that to Select it worked.

Resources