visual-studio-2008

Set a pre debug event on Visual Studio 2008

▼魔方 西西 提交于 2019-12-12 11:48:32
问题 I would like to run a task before I start debugging my program in visual studio. I need to run this task every time I debug my program, so a post-build event is not good enough. I've looked into the "Debugging" tab of the settings, but there is no such option. Is there any way to do that ? 回答1: The only thing you can try (IMO) is experiment with the Command property in the Debugging page of your Project Properties ,but i don't think will work. EDIT: if you want to start a batch file ,do it

NUnit tests in a separate project, same solution

半腔热情 提交于 2019-12-12 11:33:14
问题 I have a solution containing my main project and a test project using NUnit. Everything compiles but when I run NUnit I get the exception below after the tests load, and the tests fail. I've added the main project as a reference, and I have $(ProjectDir)bin/Debug/$(TargetName)$(TargetExt) in the arguments for NUnit in the external tools setup, with a blank initial directory. MyMainProjectTests.Database.TestAddDelete: System.BadImageFormatException : Could not load file or assembly

Visual Studio problem with deploying all files of .NET Compact Framework application

穿精又带淫゛_ 提交于 2019-12-12 11:23:43
问题 My application consist of an executable project and a dll library. My executable project has added the reference to the library project. The library project contains some "content" files like .ini .bmp. The problem is that these files are not copied to the device when I deploy the executable project. Only dll file is copied. The curious thing is that all files are copied to the \ExecutableProject\bin\Debug directory on the desktop machine. To workaround this I've set the deployment path of

How to interpret "error C2018: unknown character '0x40'? [closed]

浪子不回头ぞ 提交于 2019-12-12 10:48:27
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . While compiling some code I receive the following: "error C2018: unknown character '0x40'" I wonder how to resolve such issue? 回答1: Here is where I would begin: Have you included any non-standard include files? If so, check those for errors. Have you missed a semi-colon somewhere? Have you accidently used object

std::stringstream and std::ios::binary

久未见 提交于 2019-12-12 10:47:45
问题 I want to write to a std::stringstream without any transformation of, say line endings. I have the following code: void decrypt(std::istream& input, std::ostream& output) { while (input.good()) { char c = input.get() c ^= mask; output.put(c); if (output.bad()) { throw std::runtime_error("Output to stream failed."); } } } The following code works like a charm: std::ifstream input("foo.enc", std::ios::binary); std::ofstream output("foo.txt", std::ios::binary); decrypt(input, output); If I use a

What are the c++ compiler optimization techniques in Visual studio [closed]

只愿长相守 提交于 2019-12-12 10:38:40
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I want to know compiler optimization strategies for generating optimized object code for my c++ app in Visual studio. Currently i am

How to run a batch script after installation is finished?

给你一囗甜甜゛ 提交于 2019-12-12 10:37:47
问题 I'm working for a custom installer developed in Visual Studio 2008 (Setup & Deployment > Setup project) for a C# project. I'd like to run a batch file (*.bat) after installation is finished. How can I do that? 回答1: You will have to extend the Installer class and override the Committed event. Here is an example. Hope you will be able to find how to run a .bat file in C#. [RunInstaller(true)] public class ServiceInstaller : Installer { string strServiceName = "MyServiceName"; public

Changing the “debugging / working directory” globally (not per-user) in VS2008

孤人 提交于 2019-12-12 10:33:31
问题 I have a C++ solution in VS2008 with multiple projects. This solution contains files that are needed at runtime, which are loaded according to a path relative to the solution directory (e.g. "Testing/data/" + "dataN.bin" ). In order for this solution to work, I must set the working directory setting in the project(s) so that it will point to the solution directory (e.g. Configuration Properties >> Debugging >> Working Directory = $(SolutionDir) ). This works fine when i'm debugging on my own

Is there a simple automatic backup system for Visual Studio projects?

筅森魡賤 提交于 2019-12-12 09:50:38
问题 I'm using Visual Studio 2008 Express and I would like Visual Studio (or perhaps an Add-in) to save my whole project to some sort of auto-incrementing archive or whatever would help me recover from disasters. I don't have much need for SVN or complex versioning systems. I'm just looking for something simple and lean. Any help would be much appreciated. Jenny PS : I looked into the built-in AutoRecover feature but it doesn't seem to save more than a few files. 回答1: You're describing a source

.NET - Is there a way to programmatically fill all tables in a strongly-typed dataset?

折月煮酒 提交于 2019-12-12 09:46:22
问题 I have a SQL Server database for which I have created a strongly-typed DataSet (using the DataSet Designer in Visual Studio 2008), so all the adapters and select commands and whatnot were created for me by the wizard. It's a small database with largely static data, so I would like to pull the contents of this DB in its entirety into my application at startup, and then grab individual pieces of data as needed using LINQ. Rather than hard-code each adapter Fill call, I would like to see if