Where to Find MSBuild.exe

No Comments »

MSBuild is the build tool for Microsoft Visual Studio.  Developers use MSBuild to build a Visual Studio project or solution file from a command line, batch file, build tool, or automated script. 

A new version of MSBuild.exe is included with each version of the .NET Framework stored in “%WinDir%Microsoft.NETFramework” on your Windows PC.  The MSBuild.exe path depends on the .NET Framework version used to build your project.  Typically you will want to call the most recent version of MSBuild.exe installed on your computer:

.NET v2.0:
%WinDir%Microsoft.NETFrameworkv2.0.50727MSBuild.exe

.NET v3.5:
%WinDir%Microsoft.NETFrameworkv3.5MSBuild.exe

.NET v4.0:
%WinDir%Microsoft.NETFrameworkv4.0.30319MSBuild.exe

MSBuild Command Line Reference

C# TextBox Scroll to Cursor

No Comments »

To scroll a C# TextBox to the cursor/caret, it’s important that the TextBox is both visible and focused, then call the ScrollToCaret method:

textBox.Focus();
textBox.ScrollToCaret();

To scroll to the bottom/end of a TextBox, set the SelectionLength to 0 to remove any selection, then set SelectionStart to the end of the text in the TextBox:

textBox.SelectionLength = 0;
textBox.SelectionStart = textBox.Text.Length;
textBox.Focus();
textBox.ScrollToCaret();

Mono 2.8 Released with C# 4.0 Support

No Comments »

Mono.  Trademark by Novell.

Mono is an open source implementation of Microsoft’s .NET Framework based on the ECMA standards for C# and the Common Language Runtime.  Mono enables developers to build Linux and cross-platform applications with improved productivity.

Sponsored by Novell, Mono has released version 2.8, which includes full support for C# v4.0, improvements to the optional LLVM-based Mono backend, and more efficient garbage collection.

Download Mono 2.8

 

Get More .NET News

Are you interested in .NET development news like this without having to wade through pages of code and crap?  Then check out Dot-Net-News.com for the latest news and information about the Microsoft .NET Framework and development ecosystem, including C#, Visual Basic and Visual Studio.  No fluff, no spam, just the facts, man.

C# Code Converter

No Comments »

DeveloperFusion offers a free .NET code converter.  Simply paste your C# or VB.NET code into this web-based tool, then select your target language: C#, VB.NET, Python or Ruby.  Supports syntax up to .NET 3.5.

Code Converter

Follow C# 411 on Twitter

No Comments »

Tired of RSS feeds?  Now you can follow C# 411 on Twitter!

C# 411 on Twitter

Cool Twitter logo from here

Type Name “UITypeEditor” Not Found

1 Comment »

This is one of those “D’oh!” moments.  You’re creating your own UITypeEditor.  You know the UITypeEditor class is located in the System.Drawing.Design namespace.  So naturally you want to add to your Visual Studio project a reference to the System.Drawing.Design.dll, right?  Wrong!  When you compile your project, the following error may appear:

The type or namespace name ‘UITypeEditor’ could not be found (are you missing a using directive or an assembly reference?)

It turns out that UITypeEditor is actually defined in System.Drawing.dll, even though it’s located in the System.Drawing.Design namespace.  See the disconnect?  But you can easily solve this problem by adding to your Visual Studio project a reference to System.Drawing.dll

Add Drop Shadow to Borderless Form

8 Comments »

When you create a Form with a border, Windows automatically draws a drop shadow around the form, as shown here:

Border form with shadow

However, if you set the form’s FormBorderStyle property to None, Windows draws neither the form border nor the drop shadow, as shown here:

Borderless form with no shadow

Read the rest of this entry »

.NET Framework 4 and Extensions Poster

1 Comment »

.NET Framework 4 and Extensions Poster (PDF)

Click the image above to download a .NET Framework 4 and Extensions poster from Microsoft.

Want more .NET posters?  Devcurry has published a collection of .NET Framework and Visual Studio posters including keyboard shortcut, namespace and type posters.

.NET and Visual Studio Poster Collection

Get Temporary Directory

No Comments »

To get the path of the current user’s temporary folder, call the GetTempPath method in the System.IO namespace:

string tempPath = System.IO.Path.GetTempPath();

On Windows Vista and 7, this method will return the following path:

C:UsersUserNameAppDataLocalTemp

How  and 65279 and Other Byte Order Marks (BOM) Can Mess Up Your XML

4 Comments »

When you download XML text from the Web, you may find “garbage characters” in the start of your XML string.  For example, I encountered this result when I downloaded an XML string using WebClient.DownloadString method:

<Root><Item>Hello, World</Item></Root>

What you are likely seeing is a Byte Order Mark (BOM), which is a Unicode character that indicates the endian-ness (byte order) of a text file or stream.  The BOM is optional and will appear at the start of the text stream, if at all.  The BOM may also indicate in which of the several Unicode representations the text is encoded.

Read the rest of this entry »

« go backkeep looking »