...
Intellitrace (historical debugger) X
Test management X
What Is .NET 4.0 and VS 201 0 All About?
VS 201 0 and .NET 4.0 lay the foundations for the next epoch of .NET development and correct ...
1
Introduction
These are exciting times to be a .NET developer, and VisualStudio 201 0 (VS 201 0) and the .NET 4.0
framework have brought a bewildering number of changes. But fear not! In ... Library.
Programmers need to understand .NET 4. 0; this book will give them an excellent understanding of how
to use VS 201 0 to take advantage of the .NET 4.0 feature set, including the Parallel Extensions....
...
http://code.msdn.microsoft.com/DslTools/Wiki/View.aspx?title=What%27s%20new
http://karlshifflett.wordpress.com/ 200 9/ 10/ 30/ t4-preprocessed-text-templates-in -visual-
studio- 201 0/
VS 201 0 Premium and Ultimate
I will only be covering Professional ... following link:
http://blogs.msdn.com/ricom/
archive/ 200 9 /06 / 10/ visual- studio- why-is-there-no- 64- bit-version.aspx
.
General Improvements
VS 201 0 contains some long-awaited changes, including:
ã ...
CHAPTER 2 VISUALSTUDIO IDE AND MEF
10
Figure 2-1. VS 201 0 allows you to drag windows outside the IDE.
Improved Multitargeting Support
When a new version of Visual Studio/ .NET framework...
...
http://blogs.msdn.com/ianhu/archive/ 200 9 /05 /13/historical-debugging-in -visual- studio- team-
system- 201 0.aspx
Static Analysis of Code Contracts
Code contracts (which I cover in Chapter 3) allow you to express constraints ... Got to Do with VisualStudio Extensibility?
Visual Studio utilizes MEF in an almost identical way to the previous examples when it loads Visual
Studio extensions. When VisualStudio first loads, ... VISUALSTUDIO IDE AND MEF
26
Before you can perform any of these customizations, however, you will first need to download and
install the VisualStudio SDK.
Extensions in VS 201 0 make heavy...
... of VisualStudio after VS 201 0.
Visual Studio Shell
It is worth noting that from VS 200 8 Microsoft opened up the ability to make use of the IDE for your own
applications. This is called the Visual ... Got to Do with VisualStudio Extensibility?
Visual Studio utilizes MEF in an almost identical way to the previous examples when it loads Visual
Studio extensions. When VisualStudio first loads, ... VisualStudio Shell. A popular project using the VisualStudio Shell is the
add-on studio for the online game World of Warcraft (http://addonstudio.codeplex.com).
For more information on the Visual...
... them. In VS 201 0 to stop VisualStudio generating PIA files simply set
the Embed Interop Types property to True in Solution Explorer.
Variance
Variance has changed in .NET 4.0. At the 200 8 PDC ... Scott Hansleman’s blog (www.hanselman.
com/blog/CLRAndDLRAndBCLOhMyWhirlwindTourAroundNET4AndVisualStudio 201 0Beta1.aspx).
... mentioning is that you no longer need PIA files. In previous
versions of Visual Studio, when a COM component was referenced, VisualStudio would create an
additional assembly to describe the COM DLL...
...
interoperability with dynamic languages that support this concept.
System.Dynamic.DynamicObject
.NET 4.0 introduces a new class called DynamicObject that allows the definition of runtime behavior,
offering ... (more complexity = bad).
I’ll cover the DLR in detail later in this chapter.
Type Dynamic
.NET 4.0 introduces a new type dynamic that allows you to tell the compiler to resolve a variable’s type ... "alex" });
Console.WriteLine(
ObjectType.GetMethod("ToString", new Type [0] ).Invoke(UsingReflection, null)
);
Console.ReadKey();
By using dynamic, however, we can make...
... .entrypoint
// Code size 8 (0x8)
.maxstack 1
.locals init ( [0] string d)
IL _00 00: nop
IL _00 01: ldstr "What do I look like in IL"
IL _00 06: stloc .0
IL _00 07: ret
} // end of method ... .entrypoint
// Code size 8 (0x8)
.maxstack 1
.locals init ( [0] object d)
IL _00 00: nop
IL _00 01: ldstr "What do I look like in IL"
IL _00 06: stloc .0
IL _00 07: ret
} // end of method ... main concepts:
ã Expression trees/Abstract Syntax Trees (AST)
ã Dynamic Dispatch
ã Binders
ã IDynamicObject
ã Call Site Caching
Expression/Abstract Syntax Trees (AST)
Expression trees are...
... revised version for .NET
4.0 is currently on its way (http://csharpindepth.com/).
I spoke to Jon about his thoughts on C# 201 0.
What Do You See as the Top Feature(s) in C# 201 0, and Why?
Named arguments ... the .NET framework that was previously available as a
separate download to VisualStudio but now comes included in VS 201 0. Some developers feel that
functional languages such as F# can enable ... the default. Now, if you
don't care about (say) C# 200 8 callers, you can just provide a single method. But that would force any
C# 200 8 callers to specify all the arguments explicitly.
The...
... http://blogs.msdn.com/jgoldb/archive/
200 9 /05 /27/net-framework -4- client-profile-introduction.aspx.
CHAPTER 4
67
CLR and BCL Changes
Availability: Framework 4
In this chapter you will look ... CHAPTER 4 CLR AND BCL CHANGES
72
Garbage Collection in .NET 4.0
So what’s changed then? Prior to .NET 4. 0, a concurrent workstation GC could do most but not all of a
generation 0 and 1 ... to use a
particular framework version. It currently accepts parameters 9, 9 .0, 10, and 10. 0.
vbc /langversion:9 .0 skynet.vb
Improved Client Profile
Client profile is a lean, reduced-functionality...
... the .NET 4.0 SDK that analyzes assemblies for transparency
violations.
CHAPTER 4 CLR AND BCL CHANGES
72
Garbage Collection in .NET 4.0
So what’s changed then? Prior to .NET 4. 0, a concurrent ... framework
itself as per usual. Note that Windows Server 200 8 will still use the localized .NET 4.0 store.
Globalization Changes in .NET 4.0
There have been a huge number of globalization changes; ... http://blogs.msdn.
com/ukadc/archive/ 200 9/ 10/ 13/background-and-foreground-gc-in-net -4. aspx and http://channel9.
msdn.com/shows/Going+Deep/Maoni-Stephens-and-Andrew-Pardoe-CLR -4- Inside-Background-GC/.
GC.RegisterForFullGCNotification()...
... you get:
int a = 200 000000 0;
Console.WriteLine(a * 2);
Console.ReadKey();
Surely the result is 40 00000000 ? Running this code will give you the following answer:
-2 949 67296
NOTE
VB.NET ... main ways:
BigInteger bigIntFromDouble = new BigInteger (45 645 645 645 42332);
BigInteger assignedFromDouble = (BigInteger) 45 645 645 645 42332;
BigInteger has a number of useful (and self-explanatory) ...
SortedSet<int> MySortedSet = new SortedSet<int> { 8, 2, 1, 5, 10, 5, 10, 8 };
ISet<T> Interface
.NET 4.0 introduces ISet<T>, a new interface utilized by SortedSet and HashSet...
...
msdn.com/blogfiles/ncl/WindowsLiveWriter/NewNCLFeaturesin.NET4.0Beta2_78A0/image_2.png.
CHAPTER 4 CLR AND BCL CHANGES
83
var key = instance.CreateSubKey(subkey, RegistryKeyPermissionCheck.Default,
RegistryOptions.Volatile);
In 64- bit ... application or process is running in a 64- bit process or on a 64- bit system:
Console.WriteLine(Environment.Is64BitOperatingSystem);
Console.WriteLine(Environment.Is64BitProcess);
Stopwatch.Restart() ...
string loadbalancerIp = "http://127 .0. 0.1/";
string host = "mywebsite.com";
var request = WebRequest.Create("http://127 .0. 0.1/") as HttpWebRequest;
request.Date...
... was run on a Dell XPS M13 30 64bit Windows 7
Ultimate laptop with VisualStudio 201 0 Professional Beta 2. The laptop has an Intel Duo Core CPU 2.5
MHz, 6 MB cache, and 4 GB of memory.
CHAPTER ... popularity by state
on 3 million randomly
generated records)
5.92 3 .47 -2 .45 71%
Raytracing example 5 .03 2.79 -2. 24 80%
Interested? Thought you might be!
TIP
Want to know the sort of ... Stocks.Add(new StockQuote { ID = 4, Company = "Google", Price = 1.54m });
Stocks.Add(new StockQuote { ID = 5, Company = "Altavista", Price = 4. 74m });
Stocks.Add(new StockQuote...