Category Archives: C#

C# @keyword as escape of keyword

it is very common to see that C# code use @keyword such as @this to escape ‘this’ as keyword to use it like a local variable. 1 2 3 4 5 6 7 8 9 class @class { public static … Continue reading

Posted in C# | Comments Off on C# @keyword as escape of keyword

Operation Failed An exception was thrown while initializing part “NuGet.PackageManagement.VisualStudio.VSSolutionManager”. GetFullVsVersionString must be called on the UI thread.

Visual Studio 2015 update 3 could throw this exception. the way to fix it 1. open vs2015 and don’t open any project. 2. go to menu ‘Tools’ -> Nuget Package Manager -> Package Manager Setting 3. once you see dialog … Continue reading

Posted in C# | Comments Off on Operation Failed An exception was thrown while initializing part “NuGet.PackageManagement.VisualStudio.VSSolutionManager”. GetFullVsVersionString must be called on the UI thread.

Visual Studio 2015 with Update 2 Short cut changes

jumping between pair “#region #endregion” short cut is Ctrl+] originally. However, Now in Visual studio 2015 jump between the pair are changed to Ctrl+Shift+Up/Down. Ctrl+Shift+8 is not working any more, Ctrl+- has to be used. I will update more short … Continue reading

Posted in C# | Comments Off on Visual Studio 2015 with Update 2 Short cut changes

C# Reflection – set object enum property value

using C# Reflection can convert DataTable to Object easily. However, it may be have some problems when converting enum which is special, we don’t know enum type and enum type should get from reflection. Here is code sample for c# … Continue reading

Posted in C# | Comments Off on C# Reflection – set object enum property value