Solved

Error accessing VB dll(com interop)  in asp.net application

Posted on 2007-12-05
3
965 Views
Last Modified: 2013-11-25
I am referencing a VB6.0  DLL in an asp.net project via com interop.
When accessing the application locally on my machine (windows XP Pro) , it executes fine without any issues.

But when it was deployed on a windows 2003 server, I get the following exception:

System.UnauthorizedAccessException: Creating an instance of the COM component with CLSID {4E42032F-D910-4B4E-A627-7216892D07AC} from the IClassFactory failed due to the following error: 80070005. at _Default.btnProcess_Click(Object sender, EventArgs e)

This looks to be a  permissions issue and so I tried granting access to the ASPNET user on the com DLL to see if that resolved the issue  but that did not fix it either.
I then tried granting full permission to ASPNET user on the dll but after that I was getting the following error message&

System.Security.SecurityException at SIBS_BHIS_History.clsHistoryClass.GetLynchHistory(String& varAcct, String& varWkID, String& strXMLValue, Boolean& varDebug) at _Default.btnProcess_Click(Object sender, EventArgs e) The Zone of the assembly that failed was: MyComputer

Any help on how to resolve this problem is appreciated...
0
Comment
Question by:lavan_8
3 Comments
 
LVL 27

Expert Comment

by:Sammy
ID: 20417432
The only way I got issues like this resolved is by impersonating a user
try something like this in web.config and see if that helps

<identity impersonate = "true" userName = "Domain_Name\IWAM_SERVER" password
="***********************"/>

hope this helps
0
 
LVL 37

Accepted Solution

by:
samtran0331 earned 500 total points
ID: 20420809
>>I then tried granting full permission to ASPNET

Just to note, an ASP.Net 2.0 application on IIS6 runs under the "NETWORK SERVICE" account; not ASPNET.
0
 
LVL 1

Author Comment

by:lavan_8
ID: 20428525
Setting execute permissions on the folder for the NETWORK SERVICE account fixed the issue. Thank you for helping me out on this.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ASP.net Markup for Sub Menu 2 46
SSIS GUID Variable 2 37
orderby list (from Json) 1 31
vb.net application has warrnings about VB6 calls. 2 19
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question