如何在visual studio 2015中更改我的默认obj文件夹 [英] How to change my default obj folder in visual studio 2015

查看:117
本文介绍了如何在visual studio 2015中更改我的默认obj文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在我的consoleapplication中生成一个sql脚本时,sql脚本将在obj / debug文件夹中.Howerver,我不希望它在obj / debug中。



我尝试了什么:



我知道如何更改默认的bin / debug文件夹,但我无法更改obj 。有没有人知道这件事?非常感谢。

解决方案

这听起来很不寻常 - 但是从你的问题描述我会假设你可能不会使用正确的术语或者不知道(足够)关于.NET和构建......所以我猜你真正的问题只是你添加到项目中的sql文件的build属性。因此在VS中选择并将其构建更改为无...因此它不会被包含并复制到输出文件夹(在您的情况下为调试) - 我是对的吗?


你可能正在创建一个文件并只提供文件名,比如



 StreamWriter writer =  new  StreamWriter(  myfile.sql





当你这样做时,文件放在与执行过程相同的文件夹中,这样就是调试文件夹。为了避免这种情况并将其放在其他地方,你需要提供你想去的地方的完整路径;



 StreamWriter writer =  new  StreamWriter(  c:\ myfiles\myfile .SQL


When i generate a sql script in my consoleapplication ,the sql script will be in obj/debug folder.Howerver,i dont hope it is in obj/debug.

What I have tried:

I know how to change the default bin/debug folder,but i have no way to change obj .Is there anyone know about this?Thanks a lot.

解决方案

that sound very unusual - but from your "Problem description" I would assume you may not use correct terms or do not know (enough) about .NET and builds... So I would just guess your real problem is just the "build" property of your sql-file you added to your project. So select in in VS and change it's build to "None"... So it won't be included and copied anymore to the "output folder" (in your case "debug") - Am I right?


Chances are you are creating a file and supplying only the filename, like

StreamWriter writer = new StreamWriter("myfile.sql")



When you do that the file gets put in the same folder as the executing process, so that will be the debug folder. To avoid this and put it somewhere else you need to give the full path to where you want it to go;

StreamWriter writer = new StreamWriter("c:\myfiles\myfile.sql")


这篇关于如何在visual studio 2015中更改我的默认obj文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆