Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Crash at runtime

Posted on 2003-11-10
12
Medium Priority
?
766 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
  • 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

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.

Question has a verified solution.

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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

783 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