简体   繁体   English

将项目构建到另一个输出目录中,如何从中调试?

[英]Project build into a different output directory, how to debug from it?

I have a web application solution VS2010 where I output to 我有一个Web应用程序解决方案VS2010,我将其输出到

..\..\Project.Namespace.Bin\

When I want to debug, I get an exception because I don't have a given assembly in $(ProjectDir)\\bin\\ . 当我想调试时,出现异常,因为在$(ProjectDir)\\bin\\没有给定的程序集。

Currently my solution is to use post build events to copy stuff to the bin\\ dir, or to manually copy assemblies I don't compile myself, but rather just reference. 目前,我的解决方案是使用构建后事件将内容复制到bin\\ dir,或手动复制我自己不编译而只是参考的程序集。 I was wondering if there was a happier approach to this. 我想知道是否有更快乐的方法。 Namely, if I could just set the other directory as the "default directory to try and find reference assemblies in". 即,如果我可以将另一个目录设置为“尝试在其中查找引用程序集的默认目录”。

This issue isn't everywhere but it usually arises when something has to be read from, for instance, the web.config file, and then loaded dynamically. 这个问题并非无处不在,但通常是在必须从诸如web.config文件中读取某些内容然后进行动态加载时出现。

Try to set CopyLocal to true on your references. 尝试在您的引用上将CopyLocal设置为true。 This way all referenced dlls will be copied into your build output dir. 这样,所有引用的dll将被复制到您的生成输出目录中。

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

相关问题 将exe从一个项目复制到另一个项目的调试输出目录 - Copy exe from one project to another's debug output directory 如何在运行时从不同项目文件夹的 output 目录访问文件 - How to access a file in runtime from output directory from a different project folder 如何设置SSIS包项目的构建输出路径目录? - how to set build output path directory of SSIS package project? 将其他文件复制到输出目录以进行发布和调试? - Copy different file to output directory for release and debug? 将 SQLite 数据库文件从 class 库添加到 ASP.NET 核心 MVC Z78E6221F6393D13566681DB 项目 build398814CE 目录 - Add SQLite dtabase file from a class library to ASP.NET Core MVC output directory on project build 如何在VStudio中将项目的根目录用作调试目录? - How can I use the root directory of a project as the debug directory in VStudio? 项目输出目录中缺少DLL - DLLs Missing From Project Output Directory 如何将.exe从C ++项目复制到C#项目的输出目录? - How to copy .exe from C++ project to the output directory of a C# project? 将 ASP.NET Web Api 构建到不同的输出目录 - Build ASP.NET Web Api to a different output directory 如何获取测试项目的构建目录? - How to get build directory of a test project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM