Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.NET not executing interop functions

Reply
Thread Tools

ASP.NET not executing interop functions

 
 
=?Utf-8?B?SmFzIE1hbmdoZXJh?=
Guest
Posts: n/a
 
      04-05-2005
Hello everyone, Im having a rather strange problem with my custom ASP.NET
application. After deploying the application on a .NET v1.1 computer, the
first time the application is launched it can call an external interop and
excute commands with no problems. However, when the same system is restarted
and my application is relauched the COM commands do not function (asp &
managed code still works fine).

When I alter the permissions of any file in my application's web folder the
COM interop functions begin working again. Sometimes I open up my web config
add a blank space to the end of the file, save & exit, and voila the COM
interop works again (temporarily - until the next restart).

What is going on, is the CLR not loading the COM interop correctly? How do I
resolve this issue?


 
Reply With Quote
 
 
 
 
Rick Strahl [MVP]
Guest
Posts: n/a
 
      04-06-2005
Hi Jas,

Your best bet likely will be to stick the COM component into a COM+
Application and then assign an Impersonation to the COM+ Application.

The problem most likely is that the ASP.NET account (ASPNET or NETWORK
SERVICE by default) - which is doesn't have rights to access the DLL or
access what ever the DLL needs to have access to. IF you don't use COM+ the
DLL just inherits the ASP.NET security token.

So the two choices are: Use COM+ as described or lower the security to give
the ASP.NET account the rights it needs to access the DLL and anything the
DLL accesses. If at all possible the former is probably the better approach.
<g>

+++ Rick ---

--

Rick Strahl
West Wind Technologies
www.west-wind.com
www.west-wind.com/weblog



"Jas Manghera" <> wrote in message
news:58388DE7-7ECF-425B-8869-...
> Hello everyone, Im having a rather strange problem with my custom ASP.NET
> application. After deploying the application on a .NET v1.1 computer, the
> first time the application is launched it can call an external interop and
> excute commands with no problems. However, when the same system is
> restarted
> and my application is relauched the COM commands do not function (asp &
> managed code still works fine).
>
> When I alter the permissions of any file in my application's web folder
> the
> COM interop functions begin working again. Sometimes I open up my web
> config
> add a blank space to the end of the file, save & exit, and voila the COM
> interop works again (temporarily - until the next restart).
>
> What is going on, is the CLR not loading the COM interop correctly? How do
> I
> resolve this issue?
>
>



 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmFzIE1hbmdoZXJh?=
Guest
Posts: n/a
 
      04-06-2005
I managed a work-around by giving the ASP.NET account increased security
priveledges, thanks for your help Rick.

"Rick Strahl [MVP]" wrote:

> Hi Jas,
>
> Your best bet likely will be to stick the COM component into a COM+
> Application and then assign an Impersonation to the COM+ Application.
>
> The problem most likely is that the ASP.NET account (ASPNET or NETWORK
> SERVICE by default) - which is doesn't have rights to access the DLL or
> access what ever the DLL needs to have access to. IF you don't use COM+ the
> DLL just inherits the ASP.NET security token.
>
> So the two choices are: Use COM+ as described or lower the security to give
> the ASP.NET account the rights it needs to access the DLL and anything the
> DLL accesses. If at all possible the former is probably the better approach.
> <g>
>
> +++ Rick ---
>
> --
>
> Rick Strahl
> West Wind Technologies
> www.west-wind.com
> www.west-wind.com/weblog
>
>
>
> "Jas Manghera" <> wrote in message
> news:58388DE7-7ECF-425B-8869-...
> > Hello everyone, Im having a rather strange problem with my custom ASP.NET
> > application. After deploying the application on a .NET v1.1 computer, the
> > first time the application is launched it can call an external interop and
> > excute commands with no problems. However, when the same system is
> > restarted
> > and my application is relauched the COM commands do not function (asp &
> > managed code still works fine).
> >
> > When I alter the permissions of any file in my application's web folder
> > the
> > COM interop functions begin working again. Sometimes I open up my web
> > config
> > add a blank space to the end of the file, save & exit, and voila the COM
> > interop works again (temporarily - until the next restart).
> >
> > What is going on, is the CLR not loading the COM interop correctly? How do
> > I
> > resolve this issue?
> >
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
impersonating ASPNET account does not work for com interop? esource ASP .Net 1 08-22-2007 08:54 PM
The dependency 'Interop.MSDASC' could not be found. harinathreddy@gmail.com ASP .Net 0 08-18-2006 07:21 AM
.NET Interop with Win32 dll not completely working Jon Hinkle ASP .Net Web Services 0 10-18-2004 08:05 PM
Interop problem: Specified cast is not valid coenve ASP .Net 1 10-08-2004 03:39 PM
please help me in distinguish redefining functions, overloading functions and overriding functions. Xiangliang Meng C++ 1 06-21-2004 03:11 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57