Missing templates in Visual Studio 2010







It happens sometimes that Visual Studio installed templates are missing. To add missing templates, first, close all instance of Visual Studio and then type the following command on visual studio command prompt:

devenv /installvstemplates

Press Enter. Let the process be complete and then open visual studio. You will get all missing templates under Visual Studio installed templates.

Customizing the Appearance of the Console Window in C#





Console Class
The Console class provides basic support for applications that read characters from, and write characters to, the console. The Console class also includes members that support customization of the appearance of the console window itself. You can call the SetWindowSize method to change the number of rows and columns in the console window at the same time, or you can use the WindowHeight and WindowWidth properties to change the number of rows and columns independently of one another. You can use the ForegroundColor and BackgroundColor properties to control the color of the console window, and you can use the CursorSize and CursorVisible properties to customize the cursor in the console window.
Unfortunately, some methods of this class are not working correctly in Windows 7, or Windows 8. For example, if you want to move the Console window to the top left corner of your screen, you may write Console.SetWindowPosition(0, 0), but it does not move the window to this coordinate. You can use Windows API to address this problem. The follwoing examples show how to customize the appearance of the console window.

Creating a Fullscreen Console Window

The output is shown below:

Roslyn CTP

What is Roslyn?

Microsoft compilers have been always acting as black boxes. You provide the source text in and out the other end, you receive an assembly. All of that rich knowledge and information that the compiler produces is thrown away and unavailable for anyone else to use.

Visual Studio team has recently been working on a project called Roslyn with a goal to rewrite the C# and VB compilers and language services in managed code. This means that Microsoft is opening up the C# and Visual Basic compilers and exposing all that rich information and code analysis to be available for the software developers. Microsoft exposes a public API surface and provide extension points in the C# and VB language services. This opens up new opportunities for VS extenders to write powerful refactorings and language analysis tools, as well as allow anyone to incorporate Microsoft parsers, semantic engines, code generators and scripting in their own applications.
The Community Technological Preview (CTP) version can be downloaded from Roslyn CTP

Getting Started

After installing the Roslyn CTP, the best place to start is to open Start Menu -> Microsoft Codename Roslyn CTP -> Getting Started.
The CTP ships with quite a few samples for Visual Studio Extensions, compiler API, code issues, refactorings and so on. Most of the samples are provided for both C# and Visual Basic. You can open the sample source code from the Getting Started page.
In addition, several new project templates are available in the New Project dialog:

You can run scripts using the new rcsi.exe, which installs into %ProgramFiles(x86)%\Microsoft Codename Roslyn CTP\Binaries\rcsi.exe. You can add rcsi.exe to the path and then type rcsi .csx.
You can also copy chunks of code from a script file and send them to the C# Interactive Window (using the right-click context menu or a keyboard shortcut).

Concurrency Visualizer SDK

What is new in Concurrency Visualizer SDK?







The Concurrency Visualizer displays rich data related to CPU thread behavior, DirectX activity, and disk I/O, among other things. This information can be incredibly valuable when investigating application behavior, but sometimes it is difficult to quickly understand how the data displayed in the Concurrency Visualizer maps to application behavior. The new Concurrency Visualizer SDK, which you can use in Visual Studio 11 Developer Preview allows you to instrument your code in order to augment the visualizations displayed in the Threads View of the Concurrency Visualizer. These visualizations, referred to as “Markers”, make the Threads View data more semantically meaningful because they represent specific phases and events in your application.
For those of you who have used Scenario Markers with the Visual Studio 2010 Concurrency Visualizer, you’ll find that the Concurrency Visualizer SDK is conceptually similar, but provides much more control and flexibility.
The SDK exposes three visual primitives: Span, Flag, and Message
A span represents an interval of time in your application, such as an application phase. A flag represents a single point in time (e.g. the point where some value reached a threshold or when an exception was thrown). A message also represents a single point in time, but is meant as a visual analog to classic event-style tracing. So what might have previously been dumped to a log file can now be wrapped in a message call. This will yield visualizations in the Threads View and you’ll have the ability (via the UI) to export the data into a CSV file.

Scott Hanselman on Visual Studio 2011 in Tech.Days 2011

On November 15, 2011, Scott Hanselman presented in Tech.Days 2011 the highlights of the editor of Visual Studio 2011 Developer Preview, as well as a few of his own insights about new features in Windows 8, HTML5, Windows Phone, ASP.NET, MVC, and SignalR.











Visual Studio 2011 New Editor Features

1- CSS Color Picker
The background color property comes with the color picker popup.










2- Region Block
Region block can be created in the CSS editor.









3- Extract to User Control
In the HTML editor you have an option called “Extract to User Control” that allows you to refactor your code and put the selected code in a user control.


















Scott Hanselman: Great post!

Visual Studio 2010 and HTML5

Visual Studio 2010 was originally released without HTML5 support, but VS 2010 SP1 supports HTML5 to some extent. The entire HTML5 specification is not supported but most of the new elements and attributes are. That means you get both intellisense and validation for HTML5 with SP1.

How to turn it on?

After installing SP1 you have to tell Visual Studio to start using the HTML5 schema. Go to Tools -> Options, and then select Text Editor -> HTML -> Validation. You should now be able to select HTML5 or XHTML5 as the target schema or if you have the HTML Source Editing toolbar enabled, you can select it in the target schema dropdown.


In SP1 there are a few improvements in the CSS3 support as well, though not as elaborate as with HTML5. The editor now supports the more advanced selectors such as div:nth-child(2n+1) without giving validation errors and the new color values rgba, hsl, hsla and 8 digit hex values are also supported.
Therefore, with Visual Studio today, you can build HTML5 and CSS3 web applications on top of ASP.NET, and with SP1 Microsoft has made it a lot easier for you. All ASP.NET developers are encouraged to start taking advantage of what HTML5 and CSS3 has to offer already today. The Web Platform and Tools team takes web standards very seriously and everybody will see much better support for HTML5 and CSS3 in the future.

Copyright © All Rights Reserved - C# Learners