Interop.CDONTS problem

Hi Experts,

My system used to work but when I transfer it to another computer, I'm now getting this error:

COM object with CLSID {AF0EB60E-0775-11D1-A77D-00C04FC2F5B3} is either not valid or not registered.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: COM object with CLSID {AF0EB60E-0775-11D1-A77D-00C04FC2F5B3} is either not valid or not registered.

Source Error:


Line 719:                cdoEmail.SendForApproval(Me.Number, "New")
Line 720:            Catch e As Exception
Line 721:                Throw e
Line 722:                '            Finally
Line 723:
 

Source File: C:\Web Applications\PurchaseOrderingSystem\Business Logic\PurchaseOrder.vb    Line: 721

Stack Trace:


[COMException (0x80040154): COM object with CLSID {AF0EB60E-0775-11D1-A77D-00C04FC2F5B3} is either not valid or not registered.]
   PF.PurchaseOrder.BusinessLogic.PurchaseOrder.Save() in C:\Web Applications\PurchaseOrderingSystem\Business Logic\PurchaseOrder.vb:721
   PF.PurchaseOrder.Web.UI.WebControls.PurchaseOrder.ctrlComments.cmdSubmit_Click(Object sender, EventArgs e) in C:\Web Applications\PurchaseOrderingSystem\Web Controls Library\Purchase Order\ctrlComments.ascx.vb:71
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain() +1292

 
I'm am using Interop.CDONTS in my system.  I checked the references, Interop.CDONTS is there.  I can even see this object in the object browser.  I tried to register it using regsvr32 but I got the error:

 C:\Web Applications\PurchaseOrderingSystem\bin\Interop.CDONTS.dll was loaded but the DLLRegisterServer entry point was not found.  The file cannot be registered.

I am at a loss.  Please help.
LVL 1
MsFoxAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

martie_11Commented:
registering with regsvr32 won't work because it is used to register COM objects, but not .NET ones.

You're sure you have the dll in either the Global Assembly Cache (GAC) or in the correct application's bin directory?
martie_11Commented:
MsFoxAuthor Commented:
Hi,

I'm sure the DLL is in the bin folder but how will you know if its in the GAC?

Well, regasm seems to work, because the errors with CLSID disappears but now, I got another error.  The error before and the one now both points to :

 Dim cdoMail As CDONTS.NewMail

and my error message is:

Access is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

Thanks for your help.
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

raterusCommented:
Can you just use System.Web.Mail?  It's .Net's wrapper around CDONTS, but it works...
martie_11Commented:
Have you tried turning impersonate off and adding the {MACHINE}\ASPNET user to the premissions?

To install into the GAC try:
gacutil /i mypath\myAssembly.dll

from the VS .NET Command prompt.
martie_11Commented:
MsFox:

>I'm sure the DLL is in the bin folder but how will you know if its in the GAC?
To view assemblies that are in GAC, you can use Windows Explorer and open the %WINDIR%\Assembly folder.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.