.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan
Asad Ali
Post New Web Links

Setting process priority on C# 3.5 service project

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :.NET Framework
 
Hi all,
  I'm working on a windows service that uses WCF with names pipes and Quartz.net to perform process scheduling.  Everything is running well, except I've hit a snag.  I have one process that's quite I/O intensive, and it kills my server while it runs.  Unfortunately, I'm legacied in to some of the architecture, so the process is as optimized as I can get it.  As a result of this, I have 2 questions.

1. Each of my jobs are encapsulated within a class.  Each of these classes are instanciated and run by Quartz in it's own thread.  When the Job starts, I have the following code in the Execute function

  /// <summary>
        /// Called by the <see cref="T:Quartz.IScheduler"/> when a <see cref="T:Quartz.Trigger"/>
        ///             fires that is associated with the <see cref="T:Quartz.IJob"/>.
        /// </summary>
        /// <remarks>
        /// The implementation may wish to set a  result object on the 
        ///             JobExecutionContext before this method exits.  The result itself
        ///             is meaningless to Quartz, but may be informative to 
        ///             <see cref="T:Quartz.IJobListener"/>s or 
        ///             <see cref="T:Quartz.ITriggerListener"


View Complete Post


More Related Resource Links

Cannot register a service type without attaching the source assembly to the host process

  
I'm wondering if there is any way I can register a service type without attaching the source assembly to the host process. When I register the service type, the source assembly (which has the type) cannot be written.   I appreciate your attention.. 

Trying to call an asmx web service from a test project

  
I am trying to create a proxy for an asmx web service. The only thing I find in Visual Studio 2008 is a service reference. How do I call an asmx web service with a service reference? Certified Geek. Professional Data dude.

calling a web service on a remote server from a ASPX page (web site project VS2005)

  
HI,I am maintaining a web site project in VS2005 and have to call a new web service on a remote server. I've done add web reference, and created the .wsdl and .discomap files in the app_webReference folder.  When I try to create a object representing the web service in the code ( wsnamespace.serviceName ws = new wsnamespce.serviceName(); ) the code wouldn't compile.The web site project is already calling other web services. When I right click on the type representing the web service and "go to definition" it takes me to a proxy class (derived from of course SoapHttpClientProtocol) in the metadata. I think this is what's missing for  the new web service i'm trying to call. Have I missed any steps?Thanks in advance.-me

Workflow Service not calling workflow in another project

  
I have a windows workflow service 4.0 that calls a workflow located in another project (i.e. another assembly). I have created a project reference in my workflow service project to the workflow in the other assembly. I have set a breakpoint in the workflow service receive activity and this breakpoint is hit. Next I step into the next activity which is an activity located in another project and the debugger does not work. Also the other workflow is sending an email.  It appears that the other workflow is not being called because I never receive an email from the workflow in the other project.   Any help is greatly appreciated.

Create a new process in web service using delegated impersonation context

  
Hi, I've written an ASP.NET 2.0 web service which is consumed by a web application which goes out and gets configuration data back from newly built win2k3 servers in a large enterprise. I am using kerberos delegation and impersonation to pass through the users domain admin rights to interrogate the server which has just been built. The web pool identity (IIS 6.0) runs under a low priviledge service account. I have all the delegation part working ok. The problem I am having is that I want to programmatically kick off a process which executes a cmd line executable and redirects the output, all under the context of the user who's being impersonated. I understand that the process will be external to the impersonated thread, so will end up running under the worker process identity, which is why I'm getting an "access is denied" message. I've been reading about the CreateProcessAsUser and createprocesswithlogonw API functions but all I've seen is examples where people specifically state the username and password in their code. This is not something I can do as the environment is very secure, so what I need to do is seamlessly get the identity of the impersonated user, and some how feed that into a function which will create the process under the correct domain admins identity and feed back out the StdOuput. Is this something that can be achieved, and if so, how? Man

Analysis Service Process Dimension Cause : OLE DB error: OLE DB or ODBC error: ORA-00942: table or v

  
Dear Gurus, I'd face a "STRANGE" problem. I'm using SQL2008 connect to Oracle Data Source (OracleOldDB.1) When I process a snow-flake dimension . There is a ORA-00942 problem. But if I past the SQL Statement to a Oracle Tool . It worked without any problem. Does any body ever face this "STRANGE" problem ? And I'd try to remove this table from data-source-view and re-join it . Still same problem !!  Wilson

host and consume wcf rest service in web project in single solution

  
I have  create a solution which have multiple class library project and a web application Like Web(UI),BL,DAL etc. I have also add a WCF REST starter kit Collection project in the same Solution.WCF Rest API is working fine if I host it on IIS but i want to consume this in my web project without using IIS. Is this possible? if yes then what will be the URI  for my WCF Rest services? Add service reference is also not working because WSDL is disable in rest.

setting message sizes for wcf web service

  
Hi.    I am working on silverlight application that communicates with wcf web service. I have function on service side that takes string as parameter. like:    [OperationContract ]          bool DoSomeServiceWork (string imputText );    when i call this function (using auto generated proxy) asynchronously with string smaller than certain size (around 1000 chars) everything works fine.    As soon as string size gets larger, i get exception "The remote server returned an error: NotFound ."    Now it seems to me that problem is in message size so i tried to change maximum buffer, maximum message size everywhere in the confing files i could find them, but nothing helps.  It come to me that obviously i don't know what I'am doing so can someone help me out here ?    (i found in different forums many posts regarding maximum message size but nothing helped, most of them are suggesting changing values in various confing files but it seems it doesn't work, and there is nowhere explanation what those numbers actually change, because its obviously not parameter size for a function) I'm completely missing something out here. sending few kb to web service suppose to be easy, and I'm getting crazy here.    btw can somebody please give complete instructions

Setting message sizes for wcf web service

  
Hi.    I am working on silverlight application that communicates with wcf web service. I have function on service side that takes string as parameter. like:    [OperationContract ]          bool DoSomeServiceWork (string imputText );    when i call this function (using auto generated proxy) asynchronously with string smaller than certain size (around 1000 chars) everything works fine.    As soon as string size gets larger, i get exception "The remote server returned an error: NotFound ."    Now it seems to me that problem is in message size so i tried to change maximum buffer, maximum message size everywhere in the confing files i could find them, but nothing helps.  It come to me that obviously i don't know what I'am doing so can someone help me out here ?    (i found in different forums many posts regarding maximum message size but nothing helped, most of them are suggesting changing values in various confing files but it seems it doesn't work, and there is nowhere explanation what those numbers actually change, because its obviously not parameter size for a function) I'm completely missing something out here. sending few kb to web service suppose to be easy, and I'm getting crazy here.    btw can somebody please give complete instructions

Class project in Web Service-consuming website

  
I have a website project in VC2008. I add a web reference to a web service, and give it a name (ws). I can now do this:         ws.Service testService = new ws.Service();         ws.Customer objCustomer = testService.GetCustomer("1");   Perfect. Now, is it possible to move the Web Reference into a class file, referenced by my web project? I've done that, but now I can't access the ws object from the website application. Is this even possible? I've seen it done in another project, which I've tried to mimic exactly, but it's not working for me. Could it be an older version worked like that??   Thanks Sean

Using WCF WF Service in a Web Project without creating a host

  

Hi

I have created a WCF Workflow Service Application which contains multiple WCF Workflow Services in it. And some of these services contain multiple Send-Receive activities in a flowchart/sequence.

In the same solution, I have created a Asp.Net Web project in which I have to use these WCF WF Services. In this Web Project, I added the Service Reference of the all the WCF Workflow Services that I have, but however when I try to invoke these WF services, it gives errors.

I went thru various samples and in every sample there is ServiceHost created which makes available an endpoint, and consuming the service using this endpoint makes everything working. Now my questions are:

1. Is there no way to make WF services work properly in a Web project without creating a WF Service Host??

2. I am also having problems in persisting a workflow. As I mentioned earlier, I have some services which have multiple send-receive activities in it so I need to persist the workflow instance until the complete workflow is complete. Again, I was able to do this using the Service Host, but how to do it without using a service host?

 

The problem is I have to host web application (and hence also the WF Services) on my Web hosting (GoDaddy) and on Azure Cloud and in both the cases I cannot create a separate Workflow Console Application that will work

Setting up a Digest Authentication WCF service and consuming it

  

I have a WCF service that had been using NTLM authentication, but needed to recently switch it to digest authentication. The service is running on both an XP Professional machine, as well as a 2003 Server machine, both experiencing the same issues.

 

To set-up the digest authentication, I created the following in my web.config servicemodel section:

 

 

<bindings>
	<webHttpBinding>
		<binding name="NtlmConnect" maxBufferSize="147483647" maxBufferPoolSize="147483647" 

Workflow Approval Process not setting item's Approval Status

  

Hello,

I've been pounding my head against the desk about this all afternoon.  I have a simple workflow attached to a document library that runs on item creation.  All it does is start the approval process on the current item and emails me and a few other people a task (in parallel).  I have another workflow attached to the document library that runs on modify and it looks to see what the Approval Status of the Current Item is.  If the Approval Status is Approved, the workflow copies the item to another library then deletes the current item.  Same with rejected (only sends it to another library).  Pending does nothing.  I modified the Completed step in the approval workflow to modify the item (to make sure the second workflow triggers)

All that works except, no matter what the Approval Status is alway Approved!  Even when first create the item and run the approval process, the item comes out as approved.  I even explicately set the Approval Status to Pending at the beginning of the first WF, but right after that, the item reverts back to being Approved.  How do I make the item be Pending until everyone has responded to the approval task?  I kinda thought that was the default procedure...

Thanks!


Service Process Invocation

  

In Win7, I am running a service which launches a process which hosts the office-library (Word 2007) for the purpose doing a mail-merge. There is no interface anywhere. When I launch the mail-merge process with the service as the parent Word cannot create a document using my existing mail-merge Word doc. At first I thought the problem lied with UAC so I changed the manifest to run as admin but it seems like that was irrelevant. When I launch the process from explorer or a non-service process instead of the service it works. It is able to load Word and a document successfully. I then proceeded to use Process Monitor to see if I could get some clues as to what could be happening. As far as I can tell, when the proc is launched by the service it is using system profile since I see file paths such as c:\windows\system32\config\systemprofile and c:windows\temp instead of my user profile folders C:\Users\UserName\AppData\Roaming\Application\ etc. My service is running as my username and not localsystem. I check the username using WindowsIdentity.GetCurrent().Name and I get my correct username regardless of service/non-service invocation. I tried changing the Word startup path in the Application object but again it only succeeds in non-service mode. I'm not really even sure if this post belongs here because it crosses a few technologies but I feel like the problem li

Execute process on remote machine from windows service

  

Hi,

I am using Windows Management Instrumentation (WMI) to connect to a remote system. I am connecting to a remote system and executing an exe on the remote system. This works if it is a normal exe. I am passing the user name and the password as well.

But when I use the same code in a Windows Service, I get an error which says "Access is Denied." My requirement is to invoke the exe (every 2 hours) on client system from a windows service on the server.

My code looks like this:

Dim

 

processHandle As Integer
Dim connection

Execute process on remote machine from windows service

  

Hi,

I am using Windows Management Instrumentation (WMI) to connect to a remote system. I am connecting to a remote system and executing an exe on the remote system. This works if it is a normal exe. I am passing the user name and the password as well.

But when I use the same code in a Windows Service, I get an error which says "Access is Denied." My requirement is to invoke the exe (every 2 hours) on client system from a windows service on the server.

My code looks like this:

Dim

 

processHandle As Integer
Dim connection

Help deploying Windows Service to 64bit Server usinf Visual Studio 2008 Setup Project?

  
I have a Windows Service I created a while back for our Win2003/2008 32bit Servers, written in Visual Studio 2008, deployed via a VS2k8 Setup Project.  Everything works great, installs fine, and runs as it should.  There is no platform dependent code, it's all straight-up .Net Framework stuff, so we thought it should deploy to a Win2008 64bit Server just fine.  But this seems not to be the case.

When I try to install the Service as is on the 64bit machine, the service and associated DLL's are installed to the "C:\Windows\SysWOW64" folder, but when you right click the Service itself and look at the properties, it is trying to find the .exe file in the "C:\Windows\System32" folder. This difference prevents the service from running, obviously.

If I change the Setup Project settings, set the Target Platform to "x64" and change in the File System screen to use the "System (64-bit) Folder" placing the files in there and re-run the setup.exe on the server.... now the files are correctly installed to the "C:\Windows\System32" folder, but the Service itself is not 'installed', that is it *does not* show up in the Services Manager.

Just for the giggles of it I tried to manually install the service using 'installutil.exe' in the .Net Fra
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend