Im working on updating one of my previous applications to handle some new capabilities. The application was originally built in Visual Studio 2003 but the new version is being built in Visual Studio 2005.

My problem is that the application is made up of two projects, one of which I compile into a dll file, then reference it in the second project. This usually works just fine for me, but

Ive updated and completely rewrote and compiled the first part into a new dll file, but no matter what I do, the second part of the project keeps referencing the old dll file. Ive deleted the old and copied the new one in. Ive uninstalled the old one and re-referenced the new one. Ive done the replacement just about every way that I can think of, and still, Visual Studio 2005 is referencing the old file. None of my new classes in the dll file show up, only the old ones, some of which no longer exist. When I run the project, the old forms still show up. The properties on the dll file also show the previous version number and not the new one that currently resides in the bin file. Its as if that old dll file is stuck in the memory of the project and wont clear out.

How do I get my project to recognize and work with the updated dll file instead of the old one Any ideas would be appreciated.

Re: Visual C# IDE Help with custom dll problem

Muthu Krishnan. R

Click on the project

Right Click

Click Properties from the context menu(the last one)

Go to references tab

Find the path of that reference

Go there and delete it

Re: Visual C# IDE Help with custom dll problem


Thanks. I've done that and just tried it again. But when I re-add the new dll file, it's still showing the old dll file classes and not the new one. Even the version number is not the same as the new one.

Re: Visual C# IDE Help with custom dll problem

Muthu Krishnan. R

Right, Try this,

Go to the solution directory

Find and remove old and new dlls

Open the project with notepad (.vbproj/.csproj)

Find the reference name and remove that

Delete the .suo file (solutioname.suo)

Open the project and add the reference again

Re: Visual C# IDE Help with custom dll problem


Odd problem. Select the reference in Solution Explorer's References node and verify that Copy Local is set to True. That's the default. Now look in your project's Bin\Debug and Bin\Release folders for that copy. Delete it. Maybe the timestamp of that copy is messed up. Moved to C# IDE forum.

Re: Visual C# IDE Help with custom dll problem


OK, I've gone through the .proj file and didn't find the dll file listed (after removing it from the project again).

I couldn't find a projectname.suo file listed anywhere to delete.

I recopied everything and re-referenced the dll again and this time, when I open the project, the updated forms are there, but when I try to reference the new classes in the code, they are not showing up, the old deleted classes are still there.

I checked and made sure and Copy Local was set to true.

When I go to the project properties and look at the dll version number, it says: 1.0.2672.22489 (same as it always says)

When I right click on the dll file in Windows Explorer and go to the version tab, it says: 1.0.2783.2226

I don't know if this has anything to do with anything.

Could it have anything to do with this project originally being built in Version 2003 and then converted

I really appreciate all the help. I'm at my wits end over this.

Re: Visual C# IDE Help with custom dll problem

Chris Brandsma

Are you referencing the output of the dll, or the dll project's output (subtle difference).

You want to reference the output of the project.

Right click on your non-dll project, select Add Reference.
In the dialog that displays, click on the Projects tab.
Select your dll's project.

Next, double check your app.config or web.config for links to a spesific version of your old dll.
If you have a manafest file, do the same there.

Also, in your non-dll project, check the project properties, build tab. Make sure there isn't a custom instruction to copy a file from an unknown location there.

Lastly, tho you have probably done this already, rev up the version of your dll (the major or minor version). Just to be safe.

Re: Visual C# IDE Help with custom dll problem

Muthu Krishnan. R

Are you using any other references which refers the old reference


Is there any warnings in the ErrorList

Re: Visual C# IDE Help with custom dll problem


Dumb question please. Where do I find the app.config file. I did a search on the project folder in Windows Explorer and didn't find anything with a .config file extension.

I've gone through everything I can find to make sure it's not referencing an old version and I've also checked my Error list.

I'm about ready to do away with the dll file and just import the forms and classes into the second project directly, but I still feel that breaking everything up into smaller reusable pieces is the best solution since the dll file can be used with other applications that are planned for the future.

Re: Visual C# IDE Help with custom dll problem

Chris Brandsma

The app.config file can be found in your bin/debug or bin/release directories. In Visual Studio.Net 2005, when you create a new project it places the file in a Properties directory.

Also, in your main project, click on the dll's reference, and look at the properties. Copy Local should be checked.

If all else fails, create a brand new dll (with a new name so you know which is which) and import all of the files into it. Then proceed from there.

Re: Visual C# IDE Help with custom dll problem



I'm going to go with the rebuild route and put this one in my wierd and strange list.

The help has been really great. Thanks again.