Windows form application problem

  • Thread starter Thread starter Lee Newson
  • Start date Start date
L

Lee Newson

Hi,

I have just written my first application using VB.NET. The app works fine
when i am running it within .NET for debugging purposes, however when i try
to run the app from the .exe file that .NET creates i get the following
error message:

"An unhandled exception of type 'System.IO.FileNotFoundException' occurred
in VisioTimeline.exe

Additional information: File or assembly name AxInterop.VisOcx, or one of
its dependencies, was not found."

I have tried removing the AxInterop.VisOcx refernce from the app, rebuilding
it then putting the reference back into the solution and rebuilding it again
but i still get the same error.

When the app tries to run and consequently debugs, the disassembly is
displayed but this is in machine code, which although i touched on at uni,
doesn't mean a thing to me.

Can anyone help??

Thanks for any and all help, it is greatly appreciated

reagrds

Lee
 
How is the AxInterop.VisOcx referenced? Are you certain it is in the
correct location for the compiled version of your app?

Do you include it in the setup of your app or have you just compiled the
project and attempted to run the exe from the bin folder?
 
Hi Gerry,

It is referenced in the references section of the solution explorer (and i
have referenced it in the coed by "import AxVisOcx =
AxMicrosoft.Office.Interop.VisOcx"

After speaking with a work colleague we think the problem may have something
to do witht he assembly not being in the GAC... when trying to add this
assembly to the GAC i get an error message saying that it is not strongly
named.

I believe that the assembly came with the Visio 2003 SDK.

Unfortunately i do not have any more information. This is the first time i
have created an application using Visual Studio and the first time using hte
Visio ActiveX control so it has got me a little stumped.

Compiling and trying to run the program form the bin folder was the first
thing i did (assuming that it would work). after that i removed the
reference, rebuilt, re-referenced and rebuilt.. still no luck.

Thanks for you help.

regards

Lee
 
I'm not able to find the ocx in the SDK and I'm not sure you will find and
ActiveX control in the 2003 SDK anyway. Although there is a COM based
object library that installs with the SDK, I cannot locate the control you
are referring to.

I have yet to develop anything in .NET for Visio so I may not the be the
best person to help here but I will try nonetheless.

Here is a for a web site for you to take a look at. Althouth the site is
about C#, the code samples are in VB for this article.

I think you may find part of your answer in the fact that you may not have
run tlbimp.exe on the ocx file to apply a COM wrapper around it.

This article explains how to do just that and then how to isntall it into
the GAC by using the sn.exe utility to create a strongly named assembly.

http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=43

Hope it helps.

Gerry
 
Hi Gerry,

I have looked at the article and tried to run the tlbimp.exe on the ocx
file, however i get an error saying that the file is not a valid type
library.

Lee
 
DOH!

I thought I saw just plain .ocx as the extension. Sorry.

Now I have to try to find that control and see what I can come up with.
 
Hi Gerry,

I have just tried creating a basic form that only has the Visio Drawing
control on it... to do this i added the component to the form toolbox (this
is the Microsoft.Office.Interop.VisOcx.dll type library) when i add the
drawing control to the form it seems to automatically create the
AxInterop.VisOcx.dll file... and it is this file that is causing the problem
when i try to run the compiled exe.



lee
 
Ok, again partly my own stupidity on this one. I was looking at adding a
reference in the referece section manually.

Instead, I added the control to the toolbox. Dropped it on the form and
here is what is in my references section;

AxVisOcx
Visio
VisOcx

I'm not doing anything with the control at all, just placed it on the form.

Ran the app from the IDE, it opens and displays the Visio drawing window.

Compiled the app, ran the exe from the bin/debug folder, and all works well.

I notice that the AxInterop.VisOcx.dll is in the bin/debug folder. Is
yours?
 
Yes, this file does get created in the bin folder, the problem comes when i
try to deply the app to a different machine which has the .NET
redistibutable package installed.

I am wondering now if somehow i have to change the path to the file from
f:\...\bin\AxInterop.VisOcx.dll to something else... but i am unsure... as i
said initially this is the first time i have created either a windows app or
programmed using the visio drawing control.

Lee
 
Just make sure that you have actually added that file in setup project so
that it will be copied to the correct folder when the app is deployed on
another machine. That is likely the problem you are having.
 
Hi Gerry,

I think i may have found the problem... it would appear that the app will
only work if the other machine has VS.NET installed, it will not work in the
VS.NET redistributable package is installed... this is a problem in itself
because from my understanding we will need to get another license for .NET
to install it on the machine that my app needs to run on.

It also means that i am going to have to seperate the two modes of the
program so that the admin side cacn be used on our project managers
machines... this is not the ideal situation to be in and i can't for the
life of me understand why the app needs the full install of VS.NET to run.

I don't suppose you have any ideas why this might be the case?? or how to
solve it?

If not then thank you very much for your help with this it is has been very
appreciated.

regards

Lee
 
Interesting. I have never heard of that scenario before.

I hope it does solve your issue though.
 
Unfortunately it doesn't really solve the issue in that we can't justify
paying for a license for VS.NET just to run a singular program on a machine.

At this point i have totally run out of ideas, so much so that i may be
rasing a case with microsoft.

Thanks for your help Gerry.

regards

Lee
 
Well, it doesn't make sense to have to install VS when the redistributable
provides the necessary run times.

Sorry I couldn't be of more help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top