Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error on Automatic Build with Nant

Status
Not open for further replies.

gfender

IS-IT--Management
Joined
May 22, 2003
Messages
55
Location
GB
Hi everyone,

I'm trying to use nant to automate a VB.NET project. Let me first give some background on the project. It was developed on my local machine where I have office 2003 installed. I need to run it from a server where office is not installed.

When I try to run nant I get the following error: "Couldn't find Primary Interop Assembly 'Microsoft.office.core'." which I assume is due to not having office installed on the server. I tried copying the office file to the server directory but it still gave me the error.

Does anyone know how I might get this build to work?

Thanks for your help!!
-Gabe



Here is my build file:
Code:
<?xml version="1.0"?>
<project name="SLXLibrary" default="build">
<target name="build" description="Compile source code">
    <solution configuration="release" solutionfile="SLXLibrary.sln" />
  </target>
</project>

Here is the reference/import data from my visual basic project file.
Code:
   <References>
                <Reference
                    Name = "System"
                    AssemblyName = "System"
                />
                <Reference
                    Name = "System.Data"
                    AssemblyName = "System.Data"
                />
                <Reference
                    Name = "System.XML"
                    AssemblyName = "System.Xml"
                />
                <Reference
                    Name = "System.Web"
                    AssemblyName = "System.Web"
                    HintPath = "..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Web.dll"
                />
                <Reference
                    Name = "Microsoft.Office.Core"
                    Guid = "{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}"
                    VersionMajor = "2"
                    VersionMinor = "3"
                    Lcid = "0"
                    WrapperTool = "primary"
                    Private = "True"
                />
                <Reference
                    Name = "VBIDE"
                    Guid = "{0002E157-0000-0000-C000-000000000046}"
                    VersionMajor = "5"
                    VersionMinor = "3"
                    Lcid = "0"
                    WrapperTool = "primary"
                />
                <Reference
                    Name = "Excel"
                    Guid = "{00020813-0000-0000-C000-000000000046}"
                    VersionMajor = "1"
                    VersionMinor = "5"
                    Lcid = "0"
                    WrapperTool = "primary"
                    Private = "True"
                />
            </References>
            <Imports>
                <Import Namespace = "Microsoft.VisualBasic" />
                <Import Namespace = "System" />
                <Import Namespace = "System.Collections" />
                <Import Namespace = "System.Data" />
                <Import Namespace = "System.Diagnostics" />
            </Imports>
 
In order to get this to work, you'll need to actually install Office on the server so that all the COM references get created in the registry.

You should also know that running Office on a server is not a supported configuration, and will likely result in your violating the Microsoft license agreement. Read more at:
A good alternative is to use a 3rd party library that can read/write Office files without needing Office itself. At work we've had good results with the Syncfusion BackOffice Suite. Since it's 100% managed code, there's no COM interop slowness, and it doesn't require an Office license.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top