|
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
|
|
|
|
|
Thanks for all your help! The code access security change worked!
Lost in the vast sea of .NET
|
|
|
|
|
One problem may be that the server process which tries to execute the program is running on different credentials (for example under local system) than what you used when you tested starting the program.
Also catch all exceptions and write them to a log or whereever it's easy for you to check if the call failed.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
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
|
|
|
|
|
I would try this. Create a new generic win app to test with. Use the following overloaded version of the process.start method.
Public Shared Function Process.Start ( _
fileName As String, _
userName As String, _
password As SecureString, _
domain As String _
) As Process
Get it to work from the generic app and then change your service as needed. Services can be hard to debug. Ensure when the service is installed that the credentials on the service are correct as well (right click the service in the control panel and change as needed).
If push came to shove, you could call something like CreateProcessWithLogon or do the generic shell:
Declare Function CreateProcessWithLogon Lib "advapi32" Alias "CreateProcessWithLogonW"
If someone wants to ding me on the score fine, just let me know why. Thanks.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
modified on Thursday, October 23, 2008 2:29 PM
|
|
|
|
|
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.
|
|
|
|
|
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,
Mika
The 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
|
|
|
|
|
No problem
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Is it possible to do a dataview.Sort with part of a column? I have a datatable with 4 columns. I need to sort off the first column, but only off the first 4 characters, like this:
ORDER BY LEFT(ScheduleID,4) DESC
The above order by is valid in SQL, but doesn't appear to work in the dataview.sort using "LEFT(ScheduleID,4) DESC". Of course "ScheduleID DESC" works, but I don't get the desired results.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
No, it's not. You'd have to split the values in that column into another column with just the data that's valid for the sort, then sort on this column.
But, as you've found out, it's easier to do on the database side, and it'll have far better performance too.
|
|
|
|
|
Unfortunately, I'm building the datagridview rows from reading in a text file.
Your idea about adding a hidden sort column is brilliant!
Thanks Dave.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
I am having trouble finding documentation on how to, using Vb.net to read a png file into a string and convert to Hex.
Dow anyone have any code examples for me? Thank you
|
|
|
|
|
What do you mean by "reading a png file into a string and convert to Hex"??
Any file is just a stream of byte values, 0x00 thru 0xFF. Converting those to Hex is as easy as using String.Format("{0:X2}", value) to return a single value as a Hex string. What you do with those strings is up to you.
|
|
|
|
|
I am reading the png like this. (I don't know if this is the best way.
Dim ascii() As Byte = File.ReadAllBytes("C:\3604.png")
I want to put This into a string.
dim str as string = String.Format("{0:X2}", ascii) Does not work.
Is there an easy way besides looping through each byte and copying it to string?
|
|
|
|
|
Cory Kimble wrote: dim str as string = String.Format("{0:X2}", ascii) Does not work.
Sure it does, when you convert each and every byte in the array, individually. You can't send an array to Format and expect it to iterate over the array for you.
Cory Kimble wrote: Is there an easy way besides looping through each byte and copying it to string?
Nope. That's the only method you have.
|
|
|
|
|
Hi,
I wotre years ago in vb6 a database for music. I want to convert the whole program into VB.net 2008.
The original program was with cddb from gracenote.
The question now is is there support for .net by gracenote or is there something beter/easyer but with the same functions?
Like seeing what cds is in the drive, editing mp3 tags
If posible also support for DVD(music/films/series)
Jan
some examples from the new system are welcome
|
|
|
|
|
There's a GPL service called FreeDB[^] now.
|
|
|
|
|
What must I download?
I think the server software but thats only in C
Jan
|
|
|
|
|
Hi,
I am trying to add a 3rd party dll(C++) to my application which is created on vb.net. when i tried to add that dll as reference i got a error as "A reference to <file location=""> could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component."
When i checked this in online, it seems to be unmanged code which is not accepted by .net and also they said P/Invoke command something like that.
But actually i dont know how to register a dll or use Pinvoke method or how i add a unmanged dll into my application, Can anyone help in this.
Thanks,
Nanda
|
|
|
|
|
Register a dll using regsvr32.exe. Do you know the functions exported by the dll?
|
|
|
|
|
Thanks JZ, But again.
how to do that with regsrv32.exe, for example my dll name is nanda.dll, where i have to do this and how and what was the output
Thanks,
Nanda
|
|
|
|
|
REGSVR32 filename.dll
But, if the .DLL is not COM-based, this wont work and you'll be forced to use P/Invoke to call the functions in the .DLL. You will not be able to set a reference to it and have VS import the functions for you.
|
|
|
|