Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / October 2003

Tip: Looking for answers? Try searching our database.

Bug in Interop?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michael - 30 Oct 2003 00:47 GMT
Hi, we have a small web service that calls into some VB6
com components.  There is only one call to these
components  and this is done on a new thread in order to
use impersonation.  The problem is that on every other
call into the Com components the aspnet_wp.exe throws an
unhandled exception " 0xC0000005: Access violation
reading location " and recycles itself.
 
Has anyone else ran into this.  Not sure what could be
causing this.  Any ideas?

Also, releasecomobject is being called and even tried
garbage collecting......

Thanks for any insight....
Chris Botha - 30 Oct 2003 02:48 GMT
Michael, you don't need a new thread for impersonation, switch off anonymous
access to the web app and put
<identity impersonate="true" />
in your web.config file under the line   <system.web>   and use the main
thread and see what it does (for sure VB6 com components are not thread
safe, but it may be irrelevant in your case).

> Hi, we have a small web service that calls into some VB6
> com components.  There is only one call to these
[quoted text clipped - 11 lines]
>
> Thanks for any insight....
- 30 Oct 2003 15:30 GMT
From what I have read you need to create a new thread in
a web service when accessing Com components.  This is not
true when working with Asp.net.  Only web services...

>-----Original Message-----
>Michael, you don't need a new thread for impersonation, switch off anonymous
[quoted text clipped - 21 lines]
>
>.
Chris Botha - 30 Oct 2003 16:24 GMT
Hi.

This is interesting.  Can you remember where you read it?  I'm asking,
because I don't do it.

Thanks.

> From what I have read you need to create a new thread in
> a web service when accessing Com components.  This is not
[quoted text clipped - 31 lines]
> >
> >.
- 30 Oct 2003 16:58 GMT
We need our Com components to use a different user than
the Aspnet account....

see this microsoft article
http://support.microsoft.com/default.aspx?scid=kb;en-
us;325791

>-----Original Message-----
>Hi.
[quoted text clipped - 41 lines]
>
>.
Chris Botha - 30 Oct 2003 18:24 GMT
I had a look at the article, frightening.
What I said in my first response above was you don't have to use a second
thread in order to impersonate. I'm calling COM components with
impersonation from the main thread, and it works - after reading the article
I'm a bit nervous though.  In any case, this is what I do
(1) Take off anonymous access to the virtual directory (Internet Services
Manager)
(2) Make the following entry in the web.config file, under the line that
says "<system.web>", put a line
"<identity impersonate="true"/>"

Now you should be able to call the WEB Service from IE already, however, if
you use a Windows app that calls the service, then you may have to call
myService.Credentials = new NetworkCredential(...)   or use the
DefaultCredentials.
Note that you can also "hard-code" the UserName/Password in the web.config
file, have a look at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsent7/html/vxc
onimpersonation.asp


Please let me know if this works, so I can shrug off the nervousness.

> We need our Com components to use a different user than
> the Aspnet account....
[quoted text clipped - 58 lines]
> >
> >.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.