visual-studio

Visual Studio does not flag unterminated string constant in VB.Net

I noticed that if I leave off the terminating double quote for a string constant in Visual Studio 2010, there is no error or even a warning, i.e. Dim foo as String = "hi However, the continuous integration tool we are using flags an error: error BC30648: String constants must end with a double quote. What's going on here? Is there...

Are there design-time watch windows for Visual Studio 2008/2010?

There are many times when I need to test a little snippet of .net code but rebuilding and publishing the entire project or writing a suite of unit tests just seems like overkill. For example, I am writing a regular expression right now and I want to see if it the pattern is matching on the right parts. I could go and find a million other...

Undocumented overload of string.Split() ?

According to both Intellisense and MSDN doc on string.Split, there are no parameterless overloads of string.Split. Yet if I type in string[] foo = bar.Split(); It compiles. And it works. I have verified this in both Visual Studio 2008 and 2010. In both cases intellisense does not show the parameterless overload. Is there a reason...

Is there a way in Visual Studio to convert text to a C# string literal?

Is there a way in Visual Studio to convert text to a C# string literal and back? For example if I have the text: Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. can I easily convert it to: "Lorem ipsum dolor sit amet, consectetuer adip...

Automatically open Source Control Explorer when Visual Studio starts up

We use Visual Studio 2008/2010 and Team Foundation Server here at work. Sometimes I want to just use the Source Control Explorer. Is there a way to have Visual Studio launch and automatically open Source Control Explorer? I'm thinking ideally of having a shortcut on my taskbar or desktop that does this automatically. And yes, I do kn...

Data Generation Plan Missing from VS2010 Pro

Hi I was following this tutorial http://nepomucenobr.com.br/blog/post/Generating-e2809cdummy-datae2809d-with-Visual-Studio.aspx and I got to the point where I am should add a data generation plan file. Yet when I click on the folder there is not data generation plan file. I don't know why. Do I have to install it separately or what? ...

Manipulating the case of the build macros in Visual Studio: $(TargetDir)

I've come across a weird problem today in Visual Studio 2005. If I create a new configuration "NewConfiguration" for one of my projects. The output directory referred to by the project in $(TargetDir) is "/path/to/build/area/newconfiguration". Note the loss of capital letters, I'd expect it to be in "/path/to/build/area/NewConfigurati...

Sharing LINQ-to-SQL classes/models between multiple projects in a solution

I have multiple C# projects in a Visual Studio solution right now that will all use the same SQL Server database. What is the proper way to share LINQ-to-SQL classes between projects? I'm considering just copying the dmbl files into each project, but I think that may be too redundant. Is there a better way to approach this? ...

Visual Studio 2010 SQL Server Database Project - Ignore Stored Procedures and Functions

I really like the new SQL Server Database projects in Visual Studio 2010. I also like using the "Generate DROP statements for objects that are in the target database but that are not in the database project" option in the deployment properties. However, I do not want to manage Stored Procedures and Functions using this interface; I hav...

Organizing c# code into different files

Hi everyone. I've gotten to a point where my main code file is about a thousand lines long and it's getting un-manageable; that is, I'm starting to get confused and not know where to locate some things. It's well-commented but there's just too much stuff. I'd really like to be able to organize my code into different files, each with i...

Can Visual Studio.NET 2008 integrate SQL 2008?

Visual Studio 2008 ships with SQL 2005. I would like to integrate SQL 2008. Are there significant reasons why one could not/ can not do this? ...

Is there a way to load an existing connection string for Linq to SQL from an app.config file?

I'm running into a really annoying problem with my Linq to SQL project. When I add everything in under the web project everything goes as expected and I can tell it to use my existing connection string stored in the web.config file and the Linq code pulls directly from the ConfigurationManager. This all turns ugly once I move the code i...

Is there a way to have one project build another in Visual Studio?

We are finally getting a source control system in place at work and I've been in charge of setting it up. I've read that it's usually good practice to not include binaries in source control so I haven't. However, we have two all-purpose utility projects (each in their own solution) that generate utility .dll's which are included in alm...

How well does Visual Web Developer 2010 Express support PHP?

How well does Visual Web Developer 2010 Express support PHP? ...

C# / Visual Studio: production and test code placement

Hi, In JavaLand, I'm used to creating projects that contain both production and test code. I like this practice because it simplifies testing of internal code without artificially exposing the internals in a project's published API. So far, in my experiences with C# / Visual Studio / ReSharper / NUnit, I've created separate projects (i...

What VS Projecttype for Model and Database?

Hello folks, i've just started a new asp.net project which could increase fastly(a small erp-system for our company). So i thought it would be a good idea to split at least the model from the view/controller(the asp.net project). Because it could be that i need to access some classes and the database from a windows app in future, i dicid...

What is the significance of ProjectTypeGuids tag in the visual studio project file

What is the significance of the ProjectTypeGuids tag in a visual studio project?? When I created a WPF application, i am seeing two guids in here. {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} Does these represent WPF and Windows type of applications? If I create my own project type (.myproj) that has...

XML fragment with multiple roots: suppressing VS error

In Visual Studio, I have an XML file (with .xml extension) which contains an XML fragment that I use in my program: <tag1> data ... </tag1> <tag2> data ... </tag2> Visual Studio shows me an error in the error list: "XML document cannot contain multiple root level elements". But this is not a complete document, just a fragment that ...

Unmanaged Struct Instance in Managed Class

Hi, I've got a fairly specific problem i've been struggling with for a couple of days. I'm using a native C++, one of the methods takes a ptr to a struct containing fixed size char arrays. e.g. struct userData { char data1[10]; char data2[10]; }; method: short AddItem(long id, userData* data); I'm trying to call to c...

To Add unused reference button in C# IDE as its there in VB.NET project properties

Unused reference button not in C# IDE as its there in VB.NET project properties.It will be useful to view all unused references in all type of visual studio projects. Hoping Microsoft will fix the bug in future. See the response from MIcrosoft Connect https://connect.microsoft.com/VisualStudio/feedback/details/559625/add-unused-refe...