Code compiles but System.IO.FileNotFound Exception is thrown

2. October 2009 10:04 by Mrojas in General  //  Tags: , , , , , , ,   //   Comments (0)

We have seen a situation that can be a little annoying.
I usually find that situation in ASP.NET projects, but it can also happen in Winforms.

The issue is like this:

  • You have a VStudio Solution
  • You have added all the needed references
  • All your code compiles

 

BUT

When you run the application it terminates at a certain point with a
FileNotFound exception indicating that the assembly blablabla  or one of its
dependencies could not be loaded.

 

Whats hapenning!!!

Do this:

1) Look at the bin\debug or bin\release and make sure that the assembly is in those directories.

2) If the assembly is not there, then go to the project references in the solution explorer, right click and select properties and set the Copy Local Setting

 

image

Remove unused references VB6

28. September 2007 11:33 by Mrojas in General  //  Tags: , , , , , , , ,   //   Comments (0)

As part of the VB Companion Development group, my day to day includes
migrating several project from different clients, to develop custom mappings
and custom functionality for their migration needs or to add new features
for the next VB Companion version.

A long part of the initialization in the migration process consists of the load and
analysis of the COM references indicated in the .VBP project file.

Sometimes I have notice that there are several references that are never used.
Removing these references will provide a great save in time because the migration will
not have to incur in any time for TypeLib and TypeInfo extraction.

I look for a tool that let me get rid of the VB6 unused referencences but I found none.
So I decided to create one myself. And I created the VB6 Project References Cleaner Addin

The concept of the tool is simple, someone from a group posted the idea I just implemented.
The addin goes thru all the references and one by one tries to remove it.
And then compiles the project. It the project compiles,then the reference was not neccesary.
If you mark the remove option the tool will remove the references for you.

This tool will NOT SAVE the project file. You decide if you what to save it.

I'm attaching the source code and the dll. To used it just take the VB6References.dll and run:

  regsvr32 VB6References.dll
After that the tool will appear in the Addins menu in VB6 SOURCE CODE and BINARIES