visual-studio-2008

How do I turn off Visual Studio's formatting options?

女生的网名这么多〃 提交于 2019-12-18 07:04:52
问题 So I have this annoying issue with Visual Studio (when working with C#), I've been digging around in the C# formatting options, general VS options and on google and MSDN but can't really find a fix for this - I'm assuming there's just a checkbox somewhere and I've just overlooked it. Here it is: I like to format my code like this: Type var2 = new Type(); Type someVar = new Type(); But visual studio insists on formatting it like this, whenever the automatic format feature is applied: Type var2

Solution level build events in VS 2008

不羁岁月 提交于 2019-12-18 07:00:35
问题 I know you can have pre and post build events at a project level, but I want to stop and start a service at the beginning and end of a build of the solution -- i.e. when I do a 'Build Solution' the service is stopped and the last action of the build is to re-start the service. There are no build events on the solution property page, so what should I do? I'm guessing that I can add tasks to the msbuild file but I'm afraid I don't understand the relationship between VS and msbuild at all. Does

Error C1047: Object file created with an older compiler than other objects

て烟熏妆下的殇ゞ 提交于 2019-12-18 05:27:19
问题 I have a project that I'm building in C++ in Release mode in Visual Studio 2008 SP1 on Windows 7 and when I build it I keep getting: fatal error C1047: The object or library file '.\Release\foobar.obj' was created with an older compiler than other objects; rebuild old objects and libraries. The error occurs while linking. I've tried deleting the specific object file and rebuilding but that doesn't fix it. I've also tried blowing away the whole release build folder and rebuilding but that also

Illegal characters in path error while parsing XML in C#

会有一股神秘感。 提交于 2019-12-18 05:27:10
问题 I'm getting an "Illegal characters in path error" while using XMLTextReader method. Basically, I'm sending a long URL to tr.im, and tr.im sends the response as an XML stream, which I'm trying to parse but I get the above mentioned error. Can you guys guide me as to why I'm getting this error and where I'm going wrong? Here's the code: WebRequest wrURL; Stream objStream; string strURL; wrURL = WebRequest.Create("http://api.tr.im/api/trim_url.xml?url=" + HttpUtility.UrlEncode(txtURL.Text));

Visual Studio 2008/2010/ASP.NET: How to speed up the delay after rebuilding the solution?

為{幸葍}努か 提交于 2019-12-18 05:22:16
问题 I like to detach my debugger while testing my changes or debugging issues that can be pinpointed by a simple strack trace. After I fix a bug, I build the solution and then refresh the page. There's that initial lag time that occurs after the rebuild before the web page displays. After that, it's as fast as it should be. I heard that the application is loading up all the new DLLs during this time. Is there any way to reduce the amount of this lag? 回答1: You can set the optimizeCompilations to

The variable name '@' has already been declared. Variable names must be unique within a query batch or stored procedure. in c#

北慕城南 提交于 2019-12-18 04:55:16
问题 The variable name '@LockState' has already been declared. Variable names must be unique within a query batch or stored procedure. When I execute this code below, above error comes on my sql parameters on second @LockState. private void btn_lock2_Click(object sender, EventArgs e) { rwd.command = new SqlCommand(); rwd.command.Connection = rwd.connection; try { if ((txt2.Text == "")| (txt_desc2.Text == "")) appMessages.unCompleteFields(); else { long from = long.Parse(this.txt2.Text); long to =

strange out-of-memory exception during serialization

有些话、适合烂在心里 提交于 2019-12-18 04:46:12
问题 I am using VSTS2008 + C# + .Net 3.5 to run this console application on x64 Server 2003 Enterprise with 12G physical memory. Here is my code, and I find when executing statement bformatter.Serialize(stream, table), there is out of memory exception. I monitored memory usage through Perormance Tab of Task Manager and I find only 2G physical memory is used when exception is thrown, so should be not out of memory. :-( Any ideas what is wrong? Any limitation of .Net serialization? static DataTable

Visual Studio does not honor include directories

南楼画角 提交于 2019-12-18 04:29:13
问题 I have been in this situation quite a few times where visual studio does not honor the Additional Include Directories when it comes to lib and header source files . For example, I just downloaded MyGUI source code and made sure the include directories were correct. I even put them to absolute paths, Visual Studio still complained that it could not find specific header files. Does anybody experience the same thing with projects, and if so, is there a solution to this problem?Blockquote EDIT:

Is there a (Linux) g++ equivalent to the /fp:precise and /fp:fast flags used in Visual Studio?

混江龙づ霸主 提交于 2019-12-18 04:02:57
问题 Background: Many years ago, I inherited a codebase that was using the Visual Studio (VC++) flag '/fp:fast' to produce faster code in a particular calculation-heavy library. Unfortunately, '/fp:fast' produced results that were slightly different to the same library under a different compiler (Borland C++). As we needed to produce exactly the same results, I switched to '/fp:precise', which worked fine, and everything has been peachy ever since. However, now I'm compiling the same library with

Deadlock sample in .net?

我们两清 提交于 2019-12-18 04:02:48
问题 Can anybody give a simple Deadlock sample code in c# ? And please tell the simplest way to find deadlock in your C# code sample. (May be the tool which will detect the dead lock in the given sample code.) NOTE: I have VS 2008 回答1: one common way is if you have nested locks that aren't acquired in the same order. Thread 1 could acquire lock A and thread 2 could acquire lock B and they would deadlock. var a = new object(); var b = new object(); lock(a) { lock(b) { } } // other thread lock (b) {