.netvisual-studiofilereference

Visual Studio: referenced dll file on disk resets after adding it into resources


I want add file reference in assembly in Visual Studio to some file on the hard disk. And also i want place the file in the resources of the project. But after i added file into resources, Visual Studio replace my own file reference to resources directory. E.g. i added reference C:/Dir/myfile.dll, Visual Studio replace it with MyProject/Resources/myfile.dll. I need my assembly looking for file at C:/Dir/ location. Obviously, assembly search the file in startup directory first, and crashing if can not find it. Can I forced set my assembly searching order of referenced files?


Solution

  • I can suggest you as a workaround to rename the file that you put in the resource, that should at least stop overriding your library.