Local Copy reference problem
Hi All
I am using visual Studio 2005 Standard Edition. I have created a Class Library Add in using VB 2005. Then i added references withcopy local= true. The program complies and run smoothly.
Then i changed mycopy Local =false. It complies well. But to my surprise when i run the application it complains about missing reference and that reference happens to be the one which i made copy local=false. I am sure i have given the correct references paths and so on.
Also does any one know how to refer a COM object with Copy Local =false
Could anyone explain what's going on ?
Thanks in Advace
PRash
Hi again
Just to let you know about my error mesage a bit.
Could not load file or assembly 'Ifs.Fnd.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=ff90f512e10aef0d' or one of its dependencies. The system cannot find the file specified.
this is the error I come across when i set the reference to copy local=false
Prashweenet,
When you change the copy Local=false, I guess you will get the error message like: error CS0246: The type or namespace name '***' could not be found (are you missing a using directive or an assembly reference?) . That is because there is a property called Copy Local in your referenced class with the default value as true. The function of it is copy the referenced assembly to the output path.
Generally speaking, when the different project reference the same class, they will copy the same assembly. However, when the first assembly is copied, this will be locked. So after locking the assembly, the following reference will make the above mistake because you cannot cover the locked file.
In this situation, please set the assembly's Copy Local=false for one of your referenced projects. If there are several projects that use the same assembly, keep one of them Copy Local=true, others are false.
I don't know whether you are familiar with the GAC (Global Access Cache), there is no such kind of problems for the assemblies in GAC because the default Copy Local property is false. So I suggest you to put your reference class into GAC. That is the best solution.