Beta 1 到 Beta 2 改变详细列表（英文）3522.com：
Beta 1 to Beta 2 Changes
Heres the first thing I would do if you are a developer of .NET
- BOOKMARK THIS PAGE!
It will save you a ton of time as you migrate your apps. Then as you find a broken namespace in your app, or something else that no longer works in Beta2, click one of the links below and search the page (Ctrl-F for IE users) for your term. These documents are part of the downloads found at www.asp.net.
Here is the change list
API Changes (thanks to Alex Lowe from http://www.aspalliance.com/aldotnet/)
- API changes broken down by Namespace
Compiler and Language Changes
- C# (size 83k)
- Visual Basic.NET (size 13k)
- JScript.NET (size 10k)
- Managed Extensions for C (size 39k)
- SDK Tools Changes (size 55k)
Framework Class Library Changes
- ASP.NET (size 274k)
- ClassLib (size 410k)
- Net Classes (size 35k)
- Framework (size 390k)
- Common Language Runtime (size 39k)
- Interop (size 45k)
- JIT (size 3k)
- Metadata (size 5k)
- Miscellaneous (size 41k)
- Security (size 92k)
If you have alot of bandwidth, you can view
the whole list, but it is 1.6MEG.
CLICK HERE to view the list.
Why APIs Aren’t Portable
Here are some of the reasons APIs aren’t available in portable libraries (taken from David Kean’s MSDN article on Creating a Continuous Client Using Portable Class Libraries):
The API Isn’t Implemented by All Platforms Traditional .NET Framework file IOs, such as System.IO.File and System.IO.Directory, fall into this bucket. Silverlight and Windows Phone use the System.IO.IsolatedStorage APIs (though different from the .NET Framework version), whereas Windows Store apps use Windows.Storage.
The API Isn’t Compatible Across All Platforms Some APIs look and feel the same, but it’s hard or impossible to write code against them in a portable and consistent way. ThreadStaticAttribute, which enables static fields to have a unique value for each thread, is an example. Though it’s present on both the Windows Phone and Xbox platforms, neither of their runtimes supports it.
The API Is Considered Obsolete or Legacy
These APIs either contain behavior that’s unlikely to be present on future platforms, or they’ve been replaced by newer technologies. BackgroundWorker is an example of this; it was replaced by Task and the new asynchronous program features in Visual Studio 2012.
We Ran out of Time
Most APIs weren’t written with portability in mind. We spend a significant amount of time going through each API to make sure it can be programmed against in a portable manner. This might involve tweaking or adding to the API to make it portable. Because of the time and effort involved, in the first version of PCLs we made available on Visual Studio Gallery, we prioritized the high-value, highly used APIs. System.Xml.Linq.dll and System.ComponentModel.DataAnnotations.dll are examples of APIs that weren’t available in that first version but are now available in the Visual Studio 2012 release.
A Portable Class Library.aspx) is a .NET library that can be used (in binary form, without recompiling) on multiple .NET platforms. When you create a Portable Class Library in Visual Studio, you can choose which platforms to target. Portable libraries support targeting the .NET Framework, Silverlight, Windows Phone, Windows Store apps, and XBox 360 XNA games.
|Portable Class Library creation dialog in Visual Studio 2012|
I bet it’s not fun to keep all those projects in sync each time a file needs to be added, removed, or renamed. There are only three logical libraries here (the core library, extras, and the tests). Wouldn’t it be great to just have one portable version of each of those libraries instead of seven different ones?
Reusable Portable Libraries
|MVVM Light Toolkit Project Structure|
Trouble in Paradise
Unfortunately, it’s not that simple. The fact that Portable Class Libraries need to run on multiple platforms imposes some constraints on what you can do in them. Many .NET Framework APIs (such as File I/O or anything to do with the user interface) aren’t available. Portable libraries can’t reference non-portable libraries. You can’t use P/Invoke from most portable libraries. This is all because portable libraries are supposed to actually run on different platforms, but it means it can be more complicated to write them, and can in some cases be very difficult (or not possible) to convert existing .NET libraries to portable libraries.
We’ve seen lots of people excited about portable libraries, but we’ve also seen some people who have run into these limitations questioning whether portable libraries are useful for them. In this post, I’ll cover how you can use Portable Class Libraries even when you run into these limitations. First, let’s look at the reasons some APIs aren’t supported, and what functionality actually is supported.