Process.Start
-
I agree with catching all exceptions and the service is processing the code. Nothing fires however. I tried mapping the network directory on the server and for some reason when the service runs under the same network credentials as the login that I created the mapping it didn't recognize the path. It bailed and was caught by the try/catch logic. Like I said the credentials for the service firing off the executable is using a network credential with administrative privileges. The shell logic which was the first reply seems to work but I'm not sure why the process.start logic doesn't. Any other suggestions are appreciated.
Lost in the vast sea of .NET
KreativeKai wrote:
I tried mapping the network directory on the server and for some reason when the service runs under the same network credentials as the login that I created the mapping it didn't recognize the path.
This is because any mapping you make is specific to your logon session. Any other session using the same credentials will not see any drive you map. That's why I asked if the drive is mapped from a login script. Services run under their own login session and under an entirely different desktop. They (normally) have no idea, nor should they even care, if a user is logged on or not.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
I agree with catching all exceptions and the service is processing the code. Nothing fires however. I tried mapping the network directory on the server and for some reason when the service runs under the same network credentials as the login that I created the mapping it didn't recognize the path. It bailed and was caught by the try/catch logic. Like I said the credentials for the service firing off the executable is using a network credential with administrative privileges. The shell logic which was the first reply seems to work but I'm not sure why the process.start logic doesn't. Any other suggestions are appreciated.
Lost in the vast sea of .NET
Instead of directly starting the exe, try to use
ProcessInfo
class. Especially following properties may be helpful: - Domain - ErrorDialog - FileName - LoadUserProfile - RedirectStandardError/Output - Username/Password - WorkingDirectory Hope this helps, MikaThe need to optimize rises from a bad design. My articles[^]
-
Was this second .EXE written under .NET (C#, VB.NET)?? If so, then you're running into the Code Access Security problem where code running from a network source is not trusted. You have to tell the .NET CLR on the machine running the code to trust the network location the code is stored on or sign the code and tell it to trust code signed with a ceratin certificate.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008> Was this second .EXE written under .NET (C#, VB.NET)?? Yes > If so, then you're running into the Code Access Security problem where code running from a network > source is not trusted. You have to tell the .NET CLR on the machine running the code to trust the > network location the code is stored on or sign the code and tell it to trust code signed with a > ceratin certificate. I'm going to look into this. I've seen this problem in the past and we even have a MSI file that we created to set security on workstations. I'm going to review our documentation and tweak the server with these settings and see if it helps. Thanks! :)
Lost in the vast sea of .NET
-
> Was this second .EXE written under .NET (C#, VB.NET)?? Yes > If so, then you're running into the Code Access Security problem where code running from a network > source is not trusted. You have to tell the .NET CLR on the machine running the code to trust the > network location the code is stored on or sign the code and tell it to trust code signed with a > ceratin certificate. I'm going to look into this. I've seen this problem in the past and we even have a MSI file that we created to set security on workstations. I'm going to review our documentation and tweak the server with these settings and see if it helps. Thanks! :)
Lost in the vast sea of .NET
Just remember, you have to tweak the machine that's going to be running the code, not the server where it's stored.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Just remember, you have to tweak the machine that's going to be running the code, not the server where it's stored.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008The code running is on a server and the service calling the code is on another server. Both servers are set to full trust on the code access settings for intranet in the 1.1 configuration tool found in administrative tools. Unfortunately both apps (Service and code we're running are 2005 framework 2.0). Where do we find the configuration tool for 2.0. The framework is loaded, but the tool is not there. Is it a seperate install or is it a different process entirely? Thanks for all your help. I believe this is definitely the issue. I'm heading out for the day, but will check for a reply if you have a chance in the remainder of the day to reply. Thanks again!
Lost in the vast sea of .NET
-
The code running is on a server and the service calling the code is on another server. Both servers are set to full trust on the code access settings for intranet in the 1.1 configuration tool found in administrative tools. Unfortunately both apps (Service and code we're running are 2005 framework 2.0). Where do we find the configuration tool for 2.0. The framework is loaded, but the tool is not there. Is it a seperate install or is it a different process entirely? Thanks for all your help. I believe this is definitely the issue. I'm heading out for the day, but will check for a reply if you have a chance in the remainder of the day to reply. Thanks again!
Lost in the vast sea of .NET
-
Get the Dot Net 2.0 SDK and use mscorcfg.msc in the run window.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
I installed the Framework 2.0 SDK on the server, went to administrative tools, configuration tool for framework 2.0 and moved the Code Access Security for the Intranet Zone to Full Trust. Restarted my service and it worked without a hitch. Thanks for all your help! :)
Lost in the vast sea of .NET
-
Just remember, you have to tweak the machine that's going to be running the code, not the server where it's stored.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008Thanks for all your help! The code access security change worked! :)
Lost in the vast sea of .NET
-
Instead of directly starting the exe, try to use
ProcessInfo
class. Especially following properties may be helpful: - Domain - ErrorDialog - FileName - LoadUserProfile - RedirectStandardError/Output - Username/Password - WorkingDirectory Hope this helps, MikaThe need to optimize rises from a bad design. My articles[^]
Thanks for your help! The problem turned out to be linked to security. Thanks again! :)
Lost in the vast sea of .NET
-
Thanks for your help! The problem turned out to be linked to security. Thanks again! :)
Lost in the vast sea of .NET