简体   繁体   English

Visual Studio:将磁盘上引用的dll文件添加到资源后,将重置

[英]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. 我想将Visual Studio程序集中的文件引用添加到硬盘上的某些文件中。 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. 但是在我将文件添加到资源后,Visual Studio替换了我对资源目录的文件引用。 Eg i added reference C:/Dir/myfile.dll , Visual Studio replace it with MyProject/Resources/myfile.dll . 例如,我添加了参考C:/Dir/myfile.dll,Visual Studio将其替换为MyProject / Resources / myfile.dll I need my assembly looking for file at C:/Dir/ location. 我需要我的程序集在C:/ Dir /位置中查找文件。 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? 我可以强制设置我的程序集对引用文件的搜索顺序吗?

我可以建议您使用一种变通方法来重命名放入资源中的文件,这至少应该停止覆盖您的库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM