All posts by Ken Lin

New Feature for C# in VS2013? Nope.

As one of my previous blog “The new features introduced in each version for C# (1.0 – 5.0)“, I promised that I will come back to this when VS2013 is released. This time I come with more information about them.

.NET Framework versions


There have been seven significant releases of the .NET Framework, excluding service packs. The framework includes the compilers, runtime, and libraries. Additionally, there are other profiles such Silverlight which complicate matters.
  • 1.0 – released in 2002
  • 1.1 – released in 2003
  • 2.0 – released in 2005, with a new CLR (to handle generics and nullable types) and compilers for C# 2 and VB 8.
  • 3.0 – released in 2006, this is just 2.0 plus new libraries: Windows Presentation Foundation, Windows Communication Foundation, Workflow Foundation, and Cardspace
  • 3.5 – released in 2007, this is 3.0 plus new libraries (primarily LINQ and some extra “base” libraries such as TimeZoneInfo) and new compilers (for C# 3 and VB 9)
  • 4 – released in 2010, this includes a new CLR (v4), new libraries, and the DLR (Dynamic Language Runtime)
  • 4.5 – released in 2012, this allows for WinRT development on Windows 8 as well as extra libraries – with much wider async APIs

C# language versions


There are five significant language versions:
  • C# 1
  • C# 2, introducing generics, nullable types, anonymous methods, iterator blocks and some other more minor features
  • C# 3, introducing implicit typing, object and collection initializers, anonymous types, automatic properties, lambda expressions, extension methods, query expressions and some other minor features
  • C# 4, introducing dynamic typing, optional parameters, named arguments, and generic variance
  • C# 5, introducing asynchronous functions, caller info attributes, and a tweak to foreach iteration variable capture

See the specifications page for downloads for each version, from Microsoft and ECMA.

Visual Studio versions


For a long time, releases of Visual Studio were closely tied to framework releases. The picture has become a bit more flexible and complicated, however:
  • VS.NET 2002 – support for C# 1 and .NET 1.0
  • VS.NET 2003 – support for C# 1 and .NET 1.1
  • VS 2005 – support for C# 2 and .NET 2.0, and .NET 3.0 with an extension
  • VS 2008 – support for C# 3 and .NET 2.0, 3.0 and 3.5 (multi-targeting)
  • VS 2010 – support for C# 4 and .NET 2.0, 3.0, 3.5 and 4
  • VS 2012 – support for C# 5 and .NET 2.0 to 4.5 (including WinRT on Windows 8), and portable class libraries

That’s all the theory. Here are the practical limitations and working configurations. Note that this assumes you want to use Visual Studio – if you’re happy to use just the command line compiler, that’s a slightly different story which I’ll avoid for simplicity’s sake. (At some point I’ll return to this page to talk about C# 4 and C# 5 features, but not just now…)
  • You can’t use C# 2 features without at least VS 2005
  • You can’t use C# 3 features without VS 2008
  • You can’t ask VS 2005 or VS 2008 to target .NET 1.0 or 1.1 (there’s an extension for it, but I haven’t used it – expect some pain for debugging etc)
  • You can’t force VS 2008 to restrict you to only C# 2 features, or force VS 2005 to restrict you to C# 1 features
  • Each version of Visual Studio has its own project file format and will upgrade your older projects when you first load them in that version. (The differences between VS 2003 and VS 2005 were significant; the differences between VS 2005 and VS 2008 are much smaller.)
  • VS 2008 has special support (in project properties) for which framework version you want to target: 2.0, 3.0 or 3.5
  • You can use most C# 3 features when targeting .NET 2.0 or 3.0, but not quite all

Evolution of C# in vs2013
Evolution of C# in vs2013


You may found that there is no update on C# in VS2013. Yes, this is correct.

From the MSDN Developer Blog,
No new C# and VB Language Features in VS 2013

From the MSDN Library
What’s New in Visual Studio 2013

You may also have a look on the MSDN page for more information
.NET Framework Versions and Dependencies

AdminPak / RSAT in Windows Server 2012 and R2

Based on one of the previous post Where is AdminPak in Windows 2008 and R2 ?

RSAT (Remote Server Administration Tools) is the replacement toolkit as the AdminPak before Win2008. You may also look for the RSAT in Win Server 2012 and 2012 R2. Here are the download link,

1) Remote Server Administration Tools for Windows 8

2) Remote Server Administration Tools for Windows 8.1

You may have some questions here as I could found from the internet as well. Where is the RSAT for Win7? Is there any RSAT in WinServer 2012 and R2 for Win7?

The answer is, No. Feel bad on this answer? Here is a mapping for the better view on different RSAT for different Server version.

Server 2008 –> Vista RSAT / Win7 RSAT
Server 2008 R2 –> Win7 RSAT
Server 2012 –> Win8 RSAT / Win8.1 RSAT
Server 2012 R2 –> Win8.1 RSAT

VS2012 Update 3 / Update 4, “Unable to locate package source”

If you are going to install VS2012 Update 3/ Update 4, You may found out that a dialog box pops in the middle of the installation. It may look like this,

VS.Update.4
Unable to locate package source


It is asking you for the location of the following files
1) Windows App Certification Kit x64-x86_en-us.msp
2) Windows App Certification Kit x86-x86_en-us.msp
3) Windows App Certification Kit Native Components-x64_en-us.msp
4) Windows App Certification Kit Native Components-x64_en-us.msp

There are 2 ways that you could get these files.
1) Download the VS2012.3.iso (if you are running Update 3) or VS2012.4.iso (if you are running Update 4). Exact the contents and you will found the files when navigate to “.\packages\WinACK\”
a. VS2012.3.iso (http://go.microsoft.com/fwlink/?LinkId=301705)
b. VS2012.4.iso (http://go.microsoft.com/?linkid=9833082)

2) Download the files directly,
a. Windows App Certification Kit x64-x86_en-us.msp ( http://go.microsoft.com/fwlink/?LinkId=283370&clcid=0×409)
b. Windows App Certification Kit Native Components-x64_en-us.msp (http://go.microsoft.com/fwlink/?LinkId=283372&clcid=0×409)

Start the Update 3 / Update 4 installer again. When it asks for these files, point it to the path where you downloaded the files. The installation should proceed after this and finish successfully.

‘Microsoft.VisualStudio.Editor.Implementation.EditorPackage’ package did not load correctly

I have experience on getting an error after install Visual Studio 2012 on a new Win7 professional machine.

‘Microsoft.VisualStudio.Editor.Implementation.EditorPackage’ package did not load correctly

After getting some searching and found out that the solution is pretty simple. Removing %LOCALAPPDATA%\Microsoft\VisualStudio\11.0\ComponentModelCache and restarting VS2012 fixed the problem for me. Hope this will help if you meet the same error.

WinXP and/or Win2003 with SC Forefront Endpoint Protection installed, MsMpEng.exe crashes after definition update

Symptoms:


If you are running Windows XP and/or Windows Server 2003 with SC Forefront Endpoint Protection installed, MsMpEng.exe crashes after definition update 1.171.1.0. The system also runs slowly and almost hangs.


Impacted OS:


Windows XP, Windows Server 2003


Workaround:


Disable Behavior Monitoring feature, either in the policy or via the SCEP UI.



 


Next Action from Microsoft:


We are pending a release of a definition update so BM can be enabled again. We will actively communicate out again as soon as the definition becomes available.


How to Disable Behavior Monitoring feature:


1. Configure Policy with SCCM


2. Configure Policy by GPO


Distribute the Machine Startup/Shutdown Script in registry by using GPO


Batch:


reg add “HKLM\Software\Microsoft\Microsoft Antimalware\Real-Time Protection” /v “DisableBehaviorMonitoring” /t reg_dword /d 1 /f


3. Update Registry by entering SafeMode


You can also set below registry value to disable BM:


HKLM\Software\Microsoft\Microsoft Antimalware\Real-Time Protection
Disa
bleBehaviorMonitoring = 1  (REG_DWORD)


4. FEP – Applying Policies from the Command Prompt


http://technet.microsoft.com/en-us/library/gg412477.aspx