System.Web.Mail FAQ

Complete FAQ Listing

4.2.1 ERROR loading type library/DLL. Printer Friendly   Email This FAQ   Discuss

This is usually permissions or a corruption/not-installed problem.

To check permissions, here are a few suggestions to try. While trying these suggestions, you may want to try the most liberal settings, until it works, and then tighten the settings down to make sure your server is secure.

Suggestion 1.
Add the ASPNET account to the administrators group. Now don't get freaked out on this suggestion. It's only a test. If you add the ASPNET account to the administrators group, and the exception goes away, then you KNOW it was a permissions ERROR, and you can work from there. Just be sure to remove the ASPNET account FROM the administrators group, so you don't have a security hole in your server.

Suggestion 2.
Locate the "Common Files" folder, typically at c:\program files\common files\. Grant the ASPNET account read access to that folder, and subfolders.

Suggestion 3
Try adding the [assembly:PermissionSetAttribute(SecurityAction.RequestMinimum, Name ="LocalIntranet")] attribute to your assembly. More information on the PermissionSetAttribute attribute can be found here:

Suggestion 4
If you are using "localhost" for the SmtpMail.SmtpServer property (or if you left it blank), you may want to try the following:
Open up IIS Admin. Locate the SMTP Server, and right-click select Properties. On the Security tab, add the ASPNET account as an Operator. Close the dialoag, and stop/start the SMTP Service. If this works, I don't know how to tell you to fix this problem. Sorry. However, I consider this a security breach, and would recommend you purchase a 3rd party product, and not use System.Web.Mail. Evidently there is something funky with your machine.

Suggestion 5
Open up the registry. Locate the CDOSys.dll and the CDONTS.dll. Grant full control to the ASPNET Account. If you can't locate either of these dlls, then you probably don't have them installed on your system. You need to get them installed.

Suggestion 6
Using Windows explorer, locate the MailRoot folder ( normally found at c:\inetpub\mailroot ). Grant the ASPNET account read/write permissions to this folder, and all subfolders.

Suggestion 7
If none of these suggestions work, you may not have the CDOSys.dll/CDONTS.dll's installed on your server, or else they may be corrupted.

These dlls are usually installed with Outlook, Outlook Express, or Microsoft Office. The CDONTS.dll is installed with the older NT4 Option Pack.

This knowledgebase article may be helpful PRB: Collaboration Data Objects for Windows NT, Collaboration Data Objects for Windows 2000, and Collaboration Data Objects for Exchange 2000 Require Outlook Express

Suggestion 8
I'm outt of suggestions. If I've missed anything, that you found works for you, please email me at ERROR Loading DLL Solution"> . Other than that, I suggest you may want to talk your boss into buying you a copy of aspNetEmail.

Discuss This FAQ Item
Got a question? Another Suggestion? Want to post your solution? Discuss it below.
New Post
  • dll    [ Reply ]
    • RE: dll    [ Reply ]
  • File Not FOund Error in Sending Mail    [ Reply ]
  • File Not FOund Error in Sending Mail    [ Reply ]
  • exception in web    [ Reply ]
  • send Could not access 'CDO.Message' object    [ Reply ]
  • CDOSYS - Re-register fail and how to re-install?    [ Reply ]
  • Another solution to "Could not access 'CDO.Message' Object"    [ Reply ]
  • Error loading randomly library/DLL    [ Reply ]
  • Error while sending Mail in Asp.Net    [ Reply ]
  • problem with connecting to gmail    [ Reply ]