This issue is probably caused by me being an idiot a while back.

I installed Office 2010 beta on my dev box. It did NOT affect my project that uses Microsoft.Office.Tools.Excel

However when I decided to uninstall 2010 and go back to 2007 only to maintain some compatibility with customers etc, my project broke.

1st I started getting an exception when creating a excel object and accessing it

Exception from HRESULT: 0x800A03EC

After a bit of playing around with dlls and references I now get

Server Error in '/' Application.
--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0234: The type or namespace name 'Tools' does not exist in the namespace 'Microsoft.Office' (are you missing an assembly reference?)

Source Error:

Line 19: using System.Reflection;
Line 20: using System.Threading;
Line 21: using Excel = Microsoft.Office.Tools.Excel;
Line 22: using Microsoft.Office.Interop.Excel;
Line 23: using LumenWorks.Framework.IO.Csv;


The references are loaded and the project compiles but not working.

Has anyone got some ideas.

I am uninstalling Office 2007 and will reinstall. I am also going to try and clean out GAC of all Office dll's and reinstall Office and maybe the PIA's too.

Getting desperate..... and will never mess with a working dev box again in my life!! lesson learnt

An update to my dilema

After much wailing and nashing of teeth I thought it was time I bit the bullet so I ran up a completely new dev box and installed visual studio, office 2007 and all the usual stuff.

took a copy of my vs solution to this new box and loaded it up. a few references needed to be reloaded and the project compiles. i added crm sdk dll's to GAC and made sure my project referenced the same version.

project still compiles but...................I now get the below error when playing my project.

This .NET newbie needs some help pls. Google has not helped so much this time. I cant understand why the issue then the project seems to compile in VS perfectly and all the references look valid.

Server Error in '/' Application.
--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0234: The type or namespace name 'Crm' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

Source Error:

Line 18: using System.Reflection;
Line 19: using System.Threading;
Line 20: using Microsoft.Crm.Sdk;
Line 21: using Microsoft.Crm.SdkTypeProxy;
Line 22: using Microsoft.Office.Tools.Excel;


Source File: c:\Code\Mark\GymSports - Excel\GymSports.Web\App_Code\MagDataHelper.cs Line: 20

Now we have some progress.... After triple checking my references I noticed that copy to local was false. I think it was therefore not copying the updated dll to the dev box and was using an out of date dll.

Seems to be working fine now.

Now to go back to original dev box and see if I can resurect the project on that box :)

This question has already been answered. Start a new discussion instead.