Error hosting WCF service in windows - wcf

I am getting the following error when trying to host my WCF service in windows on the server. I am installing it using InstallUtil.exe.
I hosted the same service on my local system. It worked perfectly fine. But not working when trying on the server.
Installing assembly 'D:\wwwroot\ABCServices\ABC.servicehost.exe'.
Affected parameters are:
assemblypath = D:\wwwroot\CareScoutServices\ABC.servicehost.exe
logfile = D:\wwwroot\ABCServices\ABC.servicehost.InstallLog
logtoconsole =
Unable to create an instance of the ABC.ServiceHost.ProjectInstaller installer type.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
The inner exception System.NullReferenceException was thrown with the following error message: Object reference not set to an instance of an object..
Rolling back assembly 'D:\wwwroot\ABCServices\ABC.servicehost.exe'.
Affected parameters are:
assemblypath = D:\wwwroot\ABCServices\ABC.servicehost.exe
logfile = D:\wwwroot\ABCServices\ABC.servicehost.InstallLog
logtoconsole =
Unable to create an instance of the ABC.ServiceHost.ProjectInstaller installer type.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
The inner exception System.NullReferenceException was thrown with the following error message: Object reference not set to an instance of an object..
Can someone please help resolve this error.

This is basic but try running the InstallUtil as an administrator.

Related

Windows Azure Storage Exception with Connection String Specifying Account Name and Account Key

I am adding Windows Azure Storage to my ASP.Net application. I am using NetStandard 1.4 and am building on MacOS.
I have the following as my connection string, as recommended by learn.microsoft.com:
DefaultEndpointsProtocol=http;AccountName=XXXXXX;AccountKey=XXXXXX
I am connecting with a new Azure Storage account and have confirmed that my account name and account key are correct. Right before the call to create the table, I added a WriteLine to display the CloudStorageAccount's connection string URI just to make sure it is correct. It has the hostname.
I am getting the following error when performing "dotnet run".
Unhandled Exception: System.Reflection.TargetInvocationException:
Exception has been thrown by the target of an invocation. --->
System.AggregateException: One or more errors occurred. (An error
occurred while sending the request.) --->
Microsoft.WindowsAzure.Storage.StorageException: An error occurred
while sending the request. ---> System.Net.Http.HttpRequestException:
An error occurred while sending the request. --->
System.Net.Http.CurlException: Couldn't resolve host name
Setting explicit table storage endpoint (TableEndpoint=XXX.table.core.windows.net) didn't work either.
Are there any other reasons why Curl will fail when connecting to XXX.table.core.windows.net?
To try capture the network trace for troubleshooting? And try to ping XXX.table.core.windows.net? Is it because the DNS cache not refreshed?

WSO2-ESB-4.8.1-ERROR - AbstractPersistenceManager Unable to handle service initialization. Resource does not exist at path

I'm trying to run WSO2ESB manager node sh /home/ec2-user/wso2esb-4.8.1/bin/wso2server.sh -Dsetup. But get this errors in log:
[2015-05-18 12:04:26,644] ERROR - AbstractPersistenceManager Unable to
handle service initialization. Service: echo
org.wso2.carbon.registry.core.exceptions.ResourceNotFoundException:
Resource does not exist at path
/_system/config/repository/transports/https/listener
[2015-05-18 12:04:26,651] ERROR - DeploymentInterceptor Exception
occurred while handling service update event. {super-tenant}
org.wso2.carbon.core.persistence.PersistenceException: Unable to
handle service initialization. Service: echo
Caused by:
org.wso2.carbon.registry.core.exceptions.ResourceNotFoundException:
Resource does not exist at path
/_system/config/repository/transports/https/listener
It seems like either you have not configured the database settings or registry has not mounted properly. Please refer to this for more information.

Exception Using GDAL in WCF Rest Service

I am developing a WCF REST service (.net 4) that uses the GDAL libraries. It works great on my development machine but throws an exception on the server (Windows Server 2008 R2). The code fails at
OSGeo.GDAL.Gdal.AllRegister();
Here's the exception:
20130214081020 Exception Message: The type initializer for 'OSGeo.GDAL.GdalPINVOKE' threw an exception.
20130214081020 Exception Stack Trace: at OSGeo.GDAL.GdalPINVOKE.AllRegister()
at OSGeo.GDAL.Gdal.AllRegister()
at RasterValues.GetDemElevation(String latitude, String longitude)
20130214081020 Inner exception Message: The type initializer for 'SWIGExceptionHelper' threw an exception.
20130214081020 Inner exception stack trace: at OSGeo.GDAL.GdalPINVOKE.SWIGExceptionHelper..ctor()
at OSGeo.GDAL.GdalPINVOKE..cctor()
I have copied the GDAL files to the server and have added the path to those in the PATH environment variable.
Any thoughts on what I'm missing? Thanks!
It turns out that I needed to add the *_wrap.dll files to the bin folder of my service.

Using the trace class in new thread crashes IIS7 in vb.net/asp.net web app

This is about using Trace in multi threaded web app
I am attempting to use tracing in a new thread started with
ThreadPool.QueueUserWorkItem(AddressOf WorkMethod, autoEvent)
My code works without crashing until I add
Trace.warn(message,category)
to a function called within the new thread
The error is below, the crash usually stops the application pool, so the page fails to load and the error message must be extracted from the IIS event log
An unhandled exception occurred and the process was terminated.
Application ID: /LM/W3SVC/5/ROOT
Process ID: 2576
Exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
StackTrace: at System.Web.UI.Page.get_Trace()

Cassia Library giving exception when calling any methods

I am trying to run the Cassia library on a remote Windows Server 2008 Terminal Server. Any methods I call I get the response below.
No more data is available
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.ComponentModel.Win32Exception: No more data is available
Stack Trace:
[Win32Exception (0x80004005): No more data is available]
Cassia.Impl.NativeMethodsHelper.GetSessionInfos(ITerminalServerHandle server) +159
Cassia.Impl.TerminalServer.GetSessions() +103
I was getting this error as well. Turns out that if there are no sessions for the given server it throws this exception.
Try running qwinsta /server <servername> in a WCP shell. It should return "No session exists for *".
I worked around this by checking exception message for "no more data" and don't throw it if so. It's gross but it's an open source dll.