|
-
Nov 8th, 2002, 01:05 PM
#1
Thread Starter
Addicted Member
Services in VB.nET
I created a service in VB 6.0 which logs into exchange and does some processing on Emails.
I'm trying to recreate that service in VB.NET. Unfortunately it hasn't been cooperating.
The problem seems to stem from the fact that it's a service in the first place. Almost as though it isn't initializing the classes correctly or something. It's rather strange.
The first actual task I perform is to log into the mapi.session object and then go to get the inbox. (Because of a bug in Mapi).
But when I do this in .NET it just hangs. I put the object into my watch window... and noticed that right after...
objSession= New Mapi.Session()
Most of the properties of the Session object in the watch window say: <error: an exception of type:{System.Runtime.InteropServices.COMException} occurred>
I had a similar problem occur with my configuration class. All the public variables were errors, even though the private variables were fine....
Anyone know what the heck is going on with this? The program (and MAPI) works fine as an application... it seems just be with a service that it freaks out.
Eiredrake
-
Nov 8th, 2002, 01:48 PM
#2
Addicted Member
This may or maynot be related. I had an application that I converted to a service and quickly found out that if you are using any com or pre.net objects/controls then funny stuff tends to happen when you use them in a service. My solution was to eliminate any pre.net control that I needed and make new ones.
As I said this may or may not help.
Jeremy
-
Nov 8th, 2002, 01:51 PM
#3
Thread Starter
Addicted Member
Unfortunately
I've noticed the same pattern actually... not sure why.
Unfortunately, that would involve me essentially re-writing exchange or intercepting every email before it gets to exchange. A task that I really don't want to do.
Also doesn't really explain what happened to the class I created in .Net. When used in an Application it holds data just fine. But in a service weird drek started happening.
Eiredrake
-
Nov 8th, 2002, 06:14 PM
#4
It must have something to do with the owner of the thread, I mean the logon being used, since a service doesn't use a users logon. Maybe it is some wierd permission problem with the System logon.???
-
Nov 11th, 2002, 10:09 AM
#5
Thread Starter
Addicted Member
What?
I'm not sure I understand what you're trying to say.
Services do use a user login. Its on the "logon" tab of the service's properties in the Services Applet. You specify an account and password to use.
The whole purpose of a service is that reguardless of who is actually logged into the machine (or even nobody at all), the service is logged in under the specified user and does it thing as it would normally, without any user intervention.
As far as it being a permissions issue, that's possible. But i haven't changed the account at all. I've got the old VB6 version of the service still running on the same account. It just appears that VB.NET isn't initializing objects correctly when they are services.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|