Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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.
Posted
Updated 14-Nov-16 2:55am
Comments
PIEBALDconsult 8-Nov-16 21:22pm    
That sounds unusual; I would expect it in bin\debug. Is the file created when compiling? Or when running?
Richard MacCutchan 9-Nov-16 5:14am    
Go to the properties page for the project or source file and change it there.

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?
 
Share this answer
 
v2
Chances are you are creating a file and supplying only the filename, like

C#
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;

C#
StreamWriter writer = new StreamWriter("c:\myfiles\myfile.sql")
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900