wcf crashes in one pc and in the development pc runs perfectly - c#

hi implementing an wcf service that executes scripts (C# code) saved in a specific folder.
but i have a problem it crashes in all pcs except the pc that im developing in all are the same edition of win7 . How ican see why it's crashing ?
the WCf service is hosted in a windows service

Check out the Event Viewer, both in the Application and System sections. That might give you some clues.
Also, security is a possibility since it only runs on the dev machine. But I'd start with the events.

Related

Error IIS and Android

I'm Brazilian, and I apologize for my English, which is very bad
I've been facing a problem for some time, and I'm tired of looking for a solution in Portuguese.
I created a WCF service to be consumed by Android, hosted on a computer that I have at home with Windows server and iis installed, configured all the correct port releases for the application to work on the phone, but it has the following error in the execution: System.Reflection .TargetInvocationException
So I decided to host the WCF service on an external server, I used the number service. I just uploaded the files to it and changed the address references in the application to communicate with the WCF, and then it worked, so I guess some configuration that has to be done in IIS or in Windows itself, I'm waiting for some help. Thank you

Web browser print from service running on windows 2012

We have a automated printing service running as System account printing web urls.
The idea is using WebBrowser to load page and call Print upon it finished loading.
This works fine on Server 2003 , 2008r2 etc but does not work on Server 2012 ONLY IF it was running as a service. running as a console application works fine.
The problem:
It would load web pages fine and would call Print() , Print() will return but nothing gets printed on the default printer: no print job at all.
I thought it would be account problem so I tried to run service as the same logged on user but still does not work, if that user run application as console app then it would work fine. So default printer and user account get ruled out.
I don't think it is a code problem (it must be though) as it works for older Windows versions running as service.
It seems something fundamental got changed for a service process in server 2012.
Update 1. It may relates to How do I print an HTML document from a web service?
However it works fine for me prior server 2012.
Update 2. It does not work even the whole print happens in a separate process, i.e. my service launches a process to do print, it does not work either. Everything works fine if I run same code in console mode. It is definitely not a threading problem but rather something deep in server 2012.
Now the questions are:
What is changed? Why it stopped working?
At http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/fdcfa0fa-50aa-4a61-be79-5b4c8f65fbf7/ we see that this was reported to Microsoft and confirmed as a bug in Windows 8 and Windows Server 2012.
This bug is triggered when trying to print from a 32bit process in non-standard user session (like e.g. a service).
According to Microsoft, this a bug was resolved in Windows 8.1 and Windows Server 2012 R2. However, we could still reproduce it on Windows 8.1.
On the same site, a workaround is given by Microsoft. This workaround solved the problem for us on Windows 8.1. It probably also works on Windows 8 and Windows Server 2012.
The workaround goes as follows:
Open Regedit and go to HKEY_CLASSES_ROOT\CLSID{BA7C0D29-81CA-4901-B450-634E20BB8C34}
Check the value of the "AppID" Registry Entry. In our case this was {AA0B85DA-FDDF-4272-8D1D-FF9B966D75B0}
Now go to HKEY_CLASSES_ROOT\AppID{AA0B85DA-FDDF-4272-8D1D-FF9B966D75B0} (or the respective value you found on your system)
Under this registry key, delete the entries with the name "AccessPermission", "LaunchPermission" and "RunAs"
Since this is a bug in Windows, you cannot fix it in your code. The workaround might have side effects, but we haven't seen any so far in our scenario.

Problems with starting windows service on windows xp SP3

I'm currently facing a problem which I can not resolve and I really don't know what to do anymore.
When I'm trying to start the service I receive the message: "The service is started but again also stopped, this because that some of the services will stop if they have nothing to do, for example the performance logs and the alerts service".
I've looked into the Windows Logs but nothing is written there which could describe why my service is all the time stopping. I've also tried to fire the windows service via the command prompt which gives me the message: "The service is not started, but the service didn't return any faults.".
I've tried to remove all keys which references to my service, which didn't resolve the issue.
I've searched on google (maybe not good enough) to find an answer but I didn't found any. I did found some websites which describes what I could do, but all of these suggestions didn't work.
This is kinda ** because I do not know where to look. I do not have any error message, i do not have any id which i can use to search on. I really don't know where to start and I hope you guys can help me on this one.
Detailed explanation about the windows service
OS: Windows XP SP3
.Net Framework: .Net 4.0 Client Profile
Language: C#
Development environment: Visual Studio 2010 Professional (but Visual Studio 2012 RC is installed)
Communications: WCF (Named Pipes), WCF (BasicHTTPBinding)
Named Pipes:
I have chosen for this solution because I wanted to communicate from a windows service to a windows form application. It worked now for quite some time but suddenly my windows service shuts it self down and I couldn't restart it anymore.
There are two named pipes services implemented: An event service which will send any notification to the windows form application and an management service which gives my windows form application the possibility to maintain my windows service.
BasicHTTPBinding:
The basic http binding makes the connection to a central server. This connection is then used for streaming information from the client to the server.
I do not know which additional information you will need, but if you guys need something then I'll try to give it as detailed as possible.
Thank you in advance.
Ok, I have solved the issue and really it is a stupid one. Windows XP will not throw any error or does not report to you that the book where all logs are stored is full!!! After cleaning the log my service started perfectly and keeps running. How stupid! :)

Process.Start(object) not working

I am developing one application which creates PDF. I am using Process.Start(startInfo) to create PDF. Now when I run this application locally, it is working fine and creates PDF but when I deploy it on Development server it is not creating PDF.
I made it very simple to Process.Start("IExplore.exe"), however still it not working on Development server.
Please let me know if any other thing that I have to do it so start working?
You're probably having this issue because on your local machine you're running under your account, which has permissions to run the executable. When deployed to the dev server, it's probably running under the NETWORK SERVICE account, which probably doesn't have permissions to run the executable. You need to look into using impersonation.
I gave a detailed answer on this here:
Invoke or call C# console app from C# web service?

Better way to deploy to Windows Mobile Device

I have been working on a Windows Mobile app for a little while now (havnt done much work with mobile before) and i have been having a problem when deploying to my mobile, at the moment i can only run the application once then if i want to run it again i have to do a soft reset.
Maybe im deploying wrong? (pretty sure i am actually, im pretty much just copying the .exe file across and running it.)
What is a better way for me to deploy my application so that it can run more than once per reset?
At the moment when i try to run it for the 2nd time on my mobile nothing at all happens (yet it works fine using the Windows Mobile 6.1 emulator)
CAB files are the preferred way to deploy Windows Mobile applications. Check out this MSDN article:
CAB Files for Delivering Windows Mobile Applications
I've had some success with putting a CAB file on a web server and simply http'ing to it to download and install the CAB.

Categories