Solved

Error running asp pages when an assembly is added referencing MS Office

Posted on 2010-08-25
6
301 Views
Last Modified: 2012-05-10
Hi,

I have an asp.net application which uses .Net Framework 4.0 with IIS 6.0 and Windows Server 2003 on the host server. I've added the reference shown in the attached code, and since adding them I get this error at runtime:
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Maybe I need to add a reference in the assembly in the GAC in .Net Framework 4.0?

I would be grateful for any advice.

Louise

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

<assemblies>
        <add assembly="Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C"/>
			</assemblies>

Open in new window

0
Comment
Question by:louise001
  • 3
  • 2
6 Comments
 
LVL 6

Expert Comment

by:thaytu888888
ID: 33519965
- Add that DLL into GAC (C:/Windows/assembly)
0
 

Author Comment

by:louise001
ID: 33520106
Thanks for responding. It's already there in C:\Windows\Assembly, with the same public key token.
0
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 33520143
is Excel fully installed on the server?
using Office automation on a web server is not recommended. you should use something like http://www.aspose.com/categories/.net-components/aspose.cells-for-.net/default.aspx
0
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

 

Author Comment

by:louise001
ID: 33520298
Hi,
Yes, Excel is installed on the server but Office 2003 not 2007. I'll change the version and see if that fixes it. In the meantime could you advise a little more about Office using automation on a webserver? In code in my application I want to create Outlook messages with to and from addresses and the subject pre-set; the user would then modify as required and send him/herself. I also want to create a Word file in code which would then be saved on our network and from time to time it would be updated in Word or by code. Does that sound do-able? It's for use inside my company by only a handful of people.
Thanks,
Louise
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 33520316
0
 

Author Closing Comment

by:louise001
ID: 33521816
The issue was resolved by installing the same version of Office as referenced in the assemblies element in web.config

Thanks also for link to MS page on Office automation in asp.net
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 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

12 Experts available now in Live!

Get 1:1 Help Now