Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Crash at runtime

Posted on 2003-11-10
12
Medium Priority
?
763 Views
Last Modified: 2012-06-27
I have just tried to deploy a very small console program onto my live server and of course it crashed at run time. :( IT compiled fin on the live server.

Basically the program that works fine on my development computer opens word documents reads them and then inserts then into a database. My program references The Office XP Primary Interop Assemblies that interacts with the word object libraries.

Here is what i think is the problem.

On my development computer everything is on the same drive.
On the live server the .net framework is on the c: drive and word and my program (which includes the necessary Office XP PIA files) are on the D: drive I think the drive difference is the problem i'm trying to replicate the live server but i have very little resources at work and not much help. I have also got limited access to the live server.

the error that comes up is:

Unhandled Exception: System.IO.FileNotFoundException: File or assembly name Micr

osoft.Office.Interop.Word, or one of its dependencies, was not found.

File name: "Microsoft.Office.Interop.Word"

  at CVU.Components.Cv.ReadWordToMemory(String filename)

  at CVU.Cvs.GetCvInfo(FileInfo[] filenames)

  at CVU.MainClass.UploadCvs()

  at CVU.MainClass.Main(String[] args)


CVU is the name of my program.


any help would be fantastic.

cheers apb
0
Comment
Question by:apb2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 2
  • 2
  • +1
12 Comments
 
LVL 1

Expert Comment

by:brabchev
ID: 9714147
Do you have Office XP installed on the live server?
0
 
LVL 6

Author Comment

by:apb2
ID: 9714163
yeah office xp sbe which is istalled on the d: drive
0
 
LVL 1

Expert Comment

by:brabchev
ID: 9714228
The reason can’t be the drive difference, because the word libraries are registered.
Are Office XP PIA files and your assembly in the same directory?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 6

Author Comment

by:apb2
ID: 9714259
Basically i have put the Office XP PIA's in a subfolder in my program and then reference then in a setup.bat file that compiles the program on the live server. Then the person who administers the live server didn't have to mess around with the assemblies. It worked on my laptop and development server.

0
 
LVL 2

Expert Comment

by:sedmans
ID: 9714699
Putting the Office XP PIA's in the GAC should solve this problem.

You can also create a config file for your application and add a probing node.
0
 
LVL 6

Author Comment

by:apb2
ID: 9714864
i will try this, i'm setting up a server here at work that will replicate the settings on the live box.

But i give that a go and tell you how it goes.

cheers
0
 
LVL 10

Assisted Solution

by:ptmcomp
ptmcomp earned 1000 total points
ID: 9716505
Copy the Microsoft.Office.Interop.Word.dll in the same folder as your other executables. The interop assembly should then use the registry to locate the COM-object. (Else you would have to place the assembly in the global assembly cache wich causes many troubles with updates and patches.)
0
 
LVL 6

Author Comment

by:apb2
ID: 9731406
one final question

do you have to register the Microsoft.Office.Interop.Word.dll ??

i.e.

regedit /s Microsoft.Office.Interop.Word.dll.reg

Because i didn't register it last time even though i included both the woord interop asseblies, whould this of caused it to crash.

I assumed the PIA's where managed code and hence didn't need to be registered.
0
 
LVL 2

Accepted Solution

by:
sedmans earned 912 total points
ID: 9731470
You are correct.  PIA's are managed code and as such you do not need to register them
0
 
LVL 6

Author Comment

by:apb2
ID: 9731561
crap, well i'm testing the program tomorrow. We'll see it works.

That's strange because when you add the PIA'a to tha GAC the setup file also registers them.

fingers crossed. If it works tomorrow i'll administer the points. if not :'(

cheers

apb
0
 
LVL 6

Author Comment

by:apb2
ID: 9731579
i sent them a test program which they ran this morning and the setup file registered the PIA and i included the PIA in the same directory as the test program, it all worked fine. So i'm pretty positive it should work.

basically all the program did was display what version of word object was on the server.

fingers crossed.

apb2
0
 
LVL 6

Author Comment

by:apb2
ID: 9738316
Well it worked thanks for your help.

cheers
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

721 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