Visual Studio adds .dll and .pdb to project after compiling

大兔子大兔子 提交于 2019-12-20 07:27:13

问题


In my Visual Studio 2008 web vbproj, I have included only certain files in the bin folder. I am using browserhawk and it needs to have some browser definition files (maindefs.bdd, etc...). I now always have them when I deploy the web app.

When I compile my application, VS automatically adds the newly compiled .dlls to the project. I have tried to use "Exclude from Project" on the files that were added, but after I clean the solution, it re-adds them again.

How can I disable this action?


回答1:


You won't be able to if your bin folder is included in your project. Instead, you can put your browser definition files in your project under a separate folder, or just under the project, and change the Build Action to Content (or None) and Copy to Output Directory to Copy Always (or Copy if Newer) in the properties for each file you want to go to your bin folder. That way the files are part of the project and get added to the bin folder automatically.




回答2:


Use a Post Build Event to copy the files. Be sure the browser hawk files build action is set to "do not copy". Then goto your project properties, select the "Build Events" tab and add the following to the Post-build event command line:

copy "$(ProjectDir)\common\browserhawk*.*" "$(TargetDir)"

Be sure to include the quotes if your project path has spaces in it.



来源:https://stackoverflow.com/questions/1013419/visual-studio-adds-dll-and-pdb-to-project-after-compiling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!