visual-studio

"Shallow" display of STL containers in Visual Studio debug mode?

I hit a wall while debuging my C++ class. It's a graph of sorts, something like this: class Graph { class Node { std::map<int, Node>::iterator _neighbors[4]; }; std::map<int, Node> _map; }; Basically, each node keeps track of exactly 4 neighbors by storing iterators to them in the containing class' map. The proble...

silverlight - while creating new project I am getting error "object refernce not set to an instance of an object"

I have just started to use silverlight in visual studio 2k8. I have installed silverlight 3 tools for visual studio 2K8. Now while creating a new project an error is thrown - "object reference is not set to an instance of an object". Screen-shots are attached. Could you guyz please help? Error screen shot Create project screen shot ...

Search in Visual Studio Closes Sln

Guys, Every time I search in visual studio using CTRL+F - it seems to get to the last search item and shut down ? Then I have to reopen the solution every time and start again. Does anyone have idea why this would happen? Thx ...

Visual Studio 2005 macro to change debug properties

I don't check-in my user option files (.user) to the source code control system. This requires me to set the Debug properties of my project every time I check-out a project from repository. I want to write a macro that would set these properties for me. I'd like to set following properties - 1)Choose 'Start external program' under Start...

Build a DLL (without entry point) from the command line with MSVC.

Hi, I want to use MSVC compiler to build a DLL file. The problem is that the DLL doesn't have a main entry point. It's supposed to be a shared DLL used as a plug-in by an application. I can compile it using GCC this way: gcc -c plugin.c gcc -shared -o plugin.dll plugin.o interface.def The DEF file is to evade name mangling in a functi...

How can I have WPF use one window style for Debug mode and another for Release mode?

I have two different styles for my window: Regular - window has title bar and can be moved/resized Fixed - window has no title bar and is fixed at the center of the screen The window is too wide for either of the monitors on my development machine, but it's a perfect fit for the target/install machine. So, when debugging, I need to b...

Change the maximum width OR maximum height of a form in .net

I've been meaning to ask this question for a while. It appears that if I want to set a maximum width of a form then I have to set a maximum height as well. Is this right? If so, which of the multitude of variables do I use, in this situation, to set the maximum form height to the height of the window? Screen.PrimaryScreen.Bounds?, Sc...

.Net Namespace Question

Hi, I have two namespaces: 1) Foo.Bar 2) Another.Foo.Bar From a class in namespace 2, how do I reference a class in namespace 1? Using Foo.Bar leaves you in namespace 2 still... I hope this is reasonably clear! Thanks. ...

Is it OK to redistribute the utility installutil that ships with .NET?

I have a .NET service built with C# and it requires install util to be properly installed. However I don't trust that it's always in the right place when my installer runs on a customer's machine. Does Microsoft allow you to freely redistribute installutil with your products? ...

how do I clean up after a StreamWriter during an exception?

I'm trying to clean-up after an exception, and I'm not sure how to handle a StreamWriter. Dim sw As StreamWriter Try ''// stuff happens somethingBad1() ''//Sometimes throws an exception sw = New StreamWriter(File.Open("c:\tmp.txt", FileMode.Create)) ''// stuff happens somethingBad2() ''//Also sometimes throws a...

How can Resharper be made aware of the framework version?

I am coding in VS2008 with Resharper 4.5.1, but the projects are set to target .NET Framework 2.0. Still, Resharper is making suggestions that are relevant to the .NET 3.5 framework. For instance, it tells me that I should be using collection initializers, etc... I've looked through the settings and can't seem to find the checkbox to t...

How can I support source file subdirectories (with common file names) in Visual Studio?

I have a (C++) project that I originally developed under Linux using make to build it. I would like to also have it run in Windows and am using Visual Studio 2005 to build it. The problem I'm running into is that Visual Studio places all objects into the same output directory. This doesn't work for me because I have source files with the...

Code Coverage in VS2008 on .net runtime callable wrappers

I have a .DLL which contains .NET Runtime callable wrappers for COM/DCOM objects. I have written a testing suite in C# in VS 2008 which calls our server functions which are in the abovementioned .DLL. When code coverage was turned on and testing suite ran, code coverage test results did not yield any statistics and displayed zeroes for...

Modify Web.config during/after Web Setup project

How do I modify the web.config of a web site during the setup's execution? I would like to have the user construct a connection string and then store that in the web config. ...

Reset View in Visual Studio 2008?

For some reason, the layout and sizes of various panels in my copy of Visual Studio 2008 has gone all wonky -- for example, the Error and Output windows appear in the same tab group as my code, and their position doesn't persist if I attempt to manually move them where I want them to go. Is there some sort of way to reset all panels to t...

Publish ClickOnce from command line

Is there a way to have VS.NET 2008 execute the "Publish Now" button from the command line? I've seen posts that suggest to use msbuild /target:publish to call it. That is ok, but msbuild doesn't increment the revision number. I'm hoping for something like: devenv mysolution.sln /publish ...

How can I cancel a Visual Studio NewPendingChange event?

I'm trying to programmatically intercept and cancel a user's attempt to check out a file in TFS. Am I correct in thinking that the proper way to go about this would be to handle the NewPendingChange in a Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer ? What is the proper way for canceling the event from its event ...

Using /SafeSEH with objects compiled from K&R C?

I am trying to get /SafeSEH for a DLL I am building. The sources are all being compiled with Visual Studio 2008 SP1 with the same build options, except that one of the libraries being compiled has K&R-style C source in it. Those files are CompileAs 'C'. Here is the problem. The link fails with: fatal error LNK1281: Unable to generate ...

Visual Studios: Getting standard font... files?

I've run into another problem while fixing up my game to use this library. SDL.NET, the library I'm using for graphics and input in my VB.NET app, has its own special Font class which is entirely separate from System.Drawing.Font. Here are its two constructors: public Font(string fileName, int pointSize) public Font(byte[] array, int p...

Is there any way to get Visual Studio to reload all projects when the .proj files have changed?

If I do an svn update while I have Visual Studio open and a number of project files have changed (but not the solution file) I have to wait and click yes on the reload project dialog box every time. Sometimes this can take a while depending on how many projects have changed and how slow my pc is being. Is there a way to say 'reload a...