Solved

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

Posted on 2007-12-05
3
954 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now