473,385 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

ASP.NET not executing interop functions

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?
Nov 19 '05 #1
2 1321
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" <Ja*********@discussions.microsoft.com> wrote in message
news:58**********************************@microsof t.com...
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?

Nov 19 '05 #2
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" <Ja*********@discussions.microsoft.com> wrote in message
news:58**********************************@microsof t.com...
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?


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Sudha | last post by:
Hi All, I am trying to use COM DLL in my C#. I have added this DLL in referance and all interface are working fine. I have one issue in calling function decleared like: void...
0
by: ViperDK \(Daniel K.\) | last post by:
how can i use interop with word so i can run all word versions from 2000 *and* use the features of 2003. it seems not to work to add a reference to word2000 & 2003 at a time in a project. would i...
0
by: Dean | last post by:
Hi I am trying to debug a solution made up of a number of projects. When I step into most of the functions of any of the objects my debugger works fine. The only object that won't let me step...
2
by: Olaf | last post by:
I'm writing an application that can disable and enable a given network adapter (NIC) using C#. I realize that this can be handled using netsh.exe, but I don't want to call a process for an...
26
by: Vish | last post by:
Hi, I am trying to expose my .NET 2.0 class as a COM type using the following attributes for the attributes I have the "Register for COM Interop" build property set to true. I also have...
5
by: Richard Lewis Haggard | last post by:
I am trying to create multi-dimensioned arrays in conventional ASP pages and pass these arrays as arguments to functions that are in a C# interop assembly. ASP complains because it doesn't...
1
by: Don.Leri | last post by:
Hi, I have a logger.dll (unmanaged c++ dll compiled in vs2005). I have a C# interop to use that dll in managed code implemented in Interfaces.dll (used by other C# dlls). I also have a...
7
by: Slavan | last post by:
I am trying to execute following code: Type type = Type.GetTypeFromProgID("SomeType.SomeClass", true); object helper = Activator.CreateInstance(type); and get following RemotingException (in...
0
by: Kaysetoaster | last post by:
Hi Gurus I wrote a "Active X" UserControl DLL in VB.NET and placed it on a iis 6 webserver. I embeded it with the object tag and the communication to functions and propertys in the vb.net...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.