I am using a simple wcf service. It works on localhost but when I deploy it to winhost, a shared hosting, I get this error:
The server encountered an error processing the request. The exception message is 'Access is denied.'. See server logs for more details. The exception stack trace is:
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at ....
It actually works fine if I remove a DLLimport function that I use. I am not sure if this is a permission issue or some other errors. My dll is in my bin folder.
Thanks for the help!
I use a sort of reflector tool to read the source code, I think the exception is caused by code access security. I think following link can help you.
http://msdn.microsoft.com/en-us/magazine/cc700337.aspx
You may increase the server permission level to allow the DllImport method.
Related
I'm following the MSDN tutorial here which details how to make a basic client-server TCP chat program.
I have all the code in place, and it is compiling, however I'm hitting an issue in the socketClient class, when trying to create the new TcpListener object.
The tutorial says to use the line:
mobjClient = New TcpClient("localhost", 5000)
However, on running this, I get the error:
An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
Additional information: A non-recoverable error occurred during a database lookup
Playing with the hostname part of the constructor, I get an identical message for the following as parameters. The function call returns the name of the machine correctly.
(System.Net.Dns.GetHostName(), 5000)
I also tried using the IP of the machine, both as 127.0.0.1 and it's actual IP. Using an IP gives a slightly different error of
An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
Additional information: An invalid argument was supplied
I also found this link which is someone else using the same tutorial, which supplies complete code.
Found a partial solution on this answer
Apparently VS.net is very picky about the fact that the assembly is running on a network location. While the above links problem isn't the same, it's definitely related, as moving the project to the local drive caused the TCPListener to work properly.
I now have other bugs to work out, but I believe they are unrelated. I also could not get his app.config solution to solve my problem. Only by copying to the local disk would the program run.
mobjClient As New TcpClient("localhost", 5000)
I am having trouble deploying a Silverlight5 application. I'm releasing to a Windows server 2003 R2 running IIS6. This is the error that I get:
Load Error -
System.ServiceModel.DomainServices.Client.DomainOperationException:
Load operation failed for query 'GetvSiteSetupStatus'.
[HttpWebRequest_WebException_RemoteServer]
Arguments: NotFound
Debugging resource strings are unavailable. Often the key and arguments provide
sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.1.10411.0&File=System.Windows.dll&Key=HttpWebRequest_WebException_RemoteServer
---> System.ServiceModel.CommunicationException: [HttpWebRequest_WebException_RemoteServer]
From what I can see the control loads, but no data is shown. Running Profiler on the server shows that the queries are not run on the database at all. I suspect it to be a WCF issue, but don't know where to start looking. The error is not very clear.
Any help will be appreciated.
Thanks
I figured out my error. I was testing my page with .html instead of .aspx.
So I have my web.config connection string pointing to my SQL Server on appharbor - from local (running Visual Studios) I can login and the memberships works. However from the build that is on the hosting side I get sorry, an error occurred while processing your request.
This is strange because I made a new user from local and check with SQL Server Management Studio whether or not the data has been added to the hosting server and it WORKS.
From my latest build I get the error:
Sorry, an error occurred while processing your request.
which is weird because they both point to the same server...
Anyone have an idea of what I am doing incorrectly?
ASP.NET MVC project has the "HandleErrorAttribute" on by default. You should remove it from FilterConfig.cs in App_Start Folder to see the actual error rather than the handled response.
It's located in the RegisterGlobalFilters method where filters.Add(new HandleErrorAttribute()); should be removed.
AppHarbor has a FAQ to help you troubleshoot deployment errors like these. In particular, you should inspect the "Errors" interface on AppHarbor and disable customErrors. Please elaborate the question if the FAQ doesn't help you solve the problem.
I have developed a WCF service and, while in Visual Studio 2010, I can import the WSDL without a problem. After I've deployed it to AppFabric, I get the WSDL, but several schema files referenced internally in the WSDL cannot be found, for some reason. I don't know if it's a configuration issue, or what. The error I get when I try to process the WSDL in Visual Studio 2010 follows below:
Metadata contains a reference that cannot be resolved:
'http://myserver.mydomain.com:9871/app_deploy/MyAppService.svc?wsdl'.
The WSDL document contains links that could not be resolved.
There was an error downloading 'http://myserver.mydomain.com:9871/app_deploy/MyAppService.svc?xsd=xsd0'.
The request failed with HTTP status 502: Proxy Error ( The
specified network name is no longer available. ).
Metadata contains a reference that cannot be resolved:
'http://myserver.mydomain.com:9871/app_deploy/MyAppService.svc'.
There was no endpoint listening at http://myserver.mydomain.com:9871/app_deploy/MyAppService.svc
that could accept the message. This is
often caused by an incorrect address
or SOAP action. See InnerException, if
present, for more details.
The remote server returned an error: (404) Not Found.
If the service is defined in the current solution, try building the
solution and adding the service reference again.
The error is a proxy error because it goes through a proxy, but the error is because the page isn't there. I've tried accessing http://localhost:9871/app_deploy/MyAppService.svc?xsd=xsd0 at the server, but I get 404.
Why wouldn't these xsd files being found? Is it a deployment issue?
Any help would be greatly appreciated.
Man, I finally found the problem here. I needed write permission on C:\Windows\Temp for Application Pool user!
I'm receiving the following error after I attach the visual studio 2010 profiler to my wcf service.
The requested service,
'net.tcp://host:port/path/myservice.svc'
could not be activated. See the
server's diagnostic trace logs for
more information.
The service works great otherwise, and as soon as I stop profiling, I can connect and use the service again.
The closest I could find to a similar situation online was here, but the Net.Tcp Listener Adapter does not stop on my server, and restarting it does not help either. Neither does an iisreset.
I'm receiving the following entry in the event log:
Failed to initialize the
AppDomain:/LM/W3SVC/1/ROOT/MyService
Exception: System.Web.HttpException
Message: Could not load file or
assembly 'MyService' or one of its
dependencies. An attempt was made to
load a program with an incorrect
format. InnerException:
System.Configuration.ConfigurationErrorsException
Message: Could not load file or
assembly 'MyService' or one of
its dependencies. An attempt was made
to load a program with an incorrect
format.
InnerException:
System.BadImageFormatException
Message: Could not load file or
assembly 'MyService' or one of
its dependencies. An attempt was made
to load a program with an incorrect
format.
Does this sound like the profiler is creating a bad dll when instrumenting? If so, how would I get around that?
There were a couple issues at work here.
1) the binaries were being instrumented as 32 bit instead of 64 bit. This seemed to be a problem with the visual studio profiler, but also could have been a symptom of issue 2) I was attempting to profile remotely instead of on the physical machine which isn't supported.
I installed the command line tools on the test server and am looking to profile that way.