473,851 Members | 2,245 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Could not load file or assembly 'Microsoft.Offi ce.Interop.Outl ook, Version=12.0.0. 0,

374 Contributor

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
  7.         'Create an outlook application
  8.         Dim oApp As Microsoft.Office.Interop.Outlook.Application
  9.         oApp = New Microsoft.Office.Interop.Outlook.Application()
  11.         'Get Namespace and Logon
  12.         Dim oNS As Microsoft.Office.Interop.Outlook.NameSpace = oApp.GetNamespace("mapi")
  15.         'Create a new appointment
  17.         Dim oAppt As Microsoft.Office.Interop.Outlook.AppointmentItem
  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
  30.             oAppt.Subject = subject
  31.             oAppt.Body = body
  32.             oAppt.Location = location
  34.             oAppt.Start = start
  35.             oAppt.End = ends
  37.             oAppt.Save()
  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.Offi ce.Interop.Outl ook, Version=12.0.0. 0, Culture=neutral , PublicKeyToken= 71e9bce111e9429 c' 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\Asse mbly folder and the Microsoft.Offic e.Interop.Outlo ok assembly is within that folder and the version is

Can anyone direct to a solution if possible please.
Sep 14 '09 #1
3 11657
9,735 Recognized Expert Moderator Expert
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
374 Contributor
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}\ASPNE T 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="tr ue"/>, the identity will be the anonymous user (typically IUSR_MACHINENAM E) 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
9,735 Recognized Expert Moderator Expert
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

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. Today, I wanted to access the home page of the application again with a browser. But instead of the proper page, I just got an ugly message: Server Error in '/' Application.
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. If I copy the incHeader.ascx.vb over to the server again, it appears to recompile and works fine, again, for random period of times. Even precompiling is no help. Is there a fix or workaround so this can some stability? Any help at all is...
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 following error. Error 1 Could not load file or assembly 'Microsoft.Practices.ObjectBuilder, Version=1.0.51205.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
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, ConsecutiveDelimiter:=False, Tab:=False, _ Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _ :=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 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. C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.Graph\\Microsoft.Office.Interop.Graph.dll I have both Office 2003 and 2007 installed on my machine but wish to only reference the version 11 COM components. Do to my situation I need to use both versions of Office, but the intended...
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 outlook.interop.dll to import. Are there any dll gurus out there who can help me get this up and running with Outlook 2007? I am using VS 2005.
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 requires that assembly office Version be installed in the Global Assembly Cache (GAC) first. Please contact your system administrator* How can I remove the requirements (or solve the problem) on client PC's / server?
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 Office Word 2007, but this primary interop assembly is not installed. I have installed the interop assembly by running: PrimaryInteropAssembly.exe I also set a project reference to the Microsoft Word 12.0 Object Library but I still get this...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.