473,320 Members | 1,848 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,320 software developers and data experts.

Could not load file or assembly 'Microsoft.Office.Interop.Outlook, Version=12.0.0.0,

OuTCasT
374 256MB
Hi

I have created an asp.net project that exports items from datagridview to and outlook calendar
This is the code that i have used..

Expand|Select|Wrap|Line Numbers
  1. Dim body As String
  2.         Dim ends As String
  3.         Dim location As String
  4.         Dim start As String
  5.         Dim subject As String
  6.  
  7.         'Create an outlook application
  8.         Dim oApp As Microsoft.Office.Interop.Outlook.Application
  9.         oApp = New Microsoft.Office.Interop.Outlook.Application()
  10.  
  11.         'Get Namespace and Logon
  12.         Dim oNS As Microsoft.Office.Interop.Outlook.NameSpace = oApp.GetNamespace("mapi")
  13.  
  14.  
  15.         'Create a new appointment
  16.  
  17.         Dim oAppt As Microsoft.Office.Interop.Outlook.AppointmentItem
  18.  
  19.  
  20.  
  21.         For Each row As GridViewRow In GridView3.Rows
  22.             oNS.Logon("YourValidProfile", Missing.Value, False, True) 'todo:
  23.             oAppt = oApp.CreateItem(OlItemType.olAppointmentItem)
  24.             body = row.Cells(0).Text
  25.             ends = row.Cells(1).Text
  26.             location = row.Cells(2).Text
  27.             start = row.Cells(3).Text
  28.             subject = row.Cells(4).Text
  29.  
  30.             oAppt.Subject = subject
  31.             oAppt.Body = body
  32.             oAppt.Location = location
  33.  
  34.             oAppt.Start = start
  35.             oAppt.End = ends
  36.  
  37.             oAppt.Save()
  38.  
  39.  
  40.             oNS.Logoff()
  41.         Next
It works locally on my machine but once i have uploaded the files to the server on which the application is running then i get the following error.

Could not load file or assembly 'Microsoft.Office.Interop.Outlook, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.

I have loaded the PIA's on the server itself and have checked the C:\Windows\Assembly folder and the Microsoft.Office.Interop.Outlook assembly is within that folder and the version is 12.0.0.0

Can anyone direct to a solution if possible please.
Sep 14 '09 #1
3 11579
Frinavale
9,735 Expert Mod 8TB
You need to install Outlook on the server... the Interop class (in your project) is just a wrapper class that allows .NET to access the COM objects in the Outlook assembly. If this assembly (Outlook) is not installed on the server then this will not work.
Sep 14 '09 #2
OuTCasT
374 256MB
I have installed Outlook on the server. Now i get this response

Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80070005.

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 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
Sep 15 '09 #3
Frinavale
9,735 Expert Mod 8TB
Have you tried to do what the error message is suggesting that you try to do?
Sep 15 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: urs | last post by:
Two days ago, I built an ASP.NET 2.0 application and published it on a shared IIS 6 Web server. After publishing, and during the whole day, it worked fine. The server remained untouched since....
1
by: ddelaney | last post by:
I've seen this posted before in many places, but have yet to find a real fix. I have a web application on dev server right now, and randomly, hours or days, it returns the expception posted below. ...
5
by: BSM | last post by:
Hi, I developed one project in my Remote machine. I used Microsoft Enterprise Library. It is working fine in Remote computer. When I open the project and run in my local computer. It shows the...
0
by: Cheryl | last post by:
I am new to C# and I am trying to convert this vba code to C#: Columns("A:A").Select Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _ TextQualifier:=xlDoubleQuote,...
1
by: =?Utf-8?B?VGVycnkgQWxsZW4=?= | last post by:
When referencing the Microsoft Graph 11.0 Object Library in a C# applicaion using Visual Studio 2005 it uses the path below. ...
3
by: Brad Isaac | last post by:
Hi, I have a working app that uses interop.outlook.dll to export items to Outlook calendar. I downloaded the Primary Interop Assemblies for Office 2k7 today and still cannot get a working...
2
by: Bill Nguyen | last post by:
I installed Web Expression to my development PC . A new VS 2005 application build on our terminal server gave me this error msg: *Unable to install or run the application. The application...
0
by: Luft | last post by:
I'm just starting to work with VSTO and Word 2007 but I've run into a problem when trying to create an add-in. I get the warning: This project references the primary interop assembly for Microsoft...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.