Visual Studio Doesn’t Auto-Generate Code-Behind for XAML file
If you have a XAML file in a Visual Studio project, but for some reason, Visual Studio won’t auto-generate the code-behind for the XAML then make sure that the following line is in inside the <Project> tag of your project file:
<Import Project=”$(MSBuildBinPath)\Microsoft.WinFX.targets” />
SyncToy 1.4 and Vista x64 Error (Fixed)
If you are receiving the following error when trying to run SyncToy 1.4 on Vista x64:
Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: synctoy.exe
Problem Signature 02: 1.4.0.0
Problem Signature 03: 453f990b
Problem Signature 04: SqmManagedWrapper
Problem Signature 05: 1.4.0.0
Problem Signature 06: 453f9909
Problem Signature 07: 8
Problem Signature 08: 38
Problem Signature 09: System.BadImageFormatException
OS Version: 6.0.6000.2.0.0.256.1
Locale ID: 3081
Then here is a fix:
- Install Microsoft Net Monitor 3.0.
- Copy the custsat.dll file from C:\Program Files\Microsoft Network Monitor 3.0\ (or wherever your Net Monitor installation is located).
- Paste the file into C:\Users\YourLoginName\AppData\Local\SyncToy\ (or wherever your SyncToy installation is located).
That’s it! Happy Syncing.
Smart Client Software Factory and Setup Error 2869
I received this error while trying to install the Smart Client Software Factory. The workarounds are:
- Disable UAC (in my case) or else install using an administrator command prompt.
- Close Visual Studio.
Apparently, the install messes with devenv.exe, which is my Visual Studio had to be closed.
Type Coloring (+1 C#)
C# colors types differently. This makes it easy to spot the types from methods and properties.
Runtime Editing (+1 VB.Net)
It seems that when running a C# project, you can only edit C# code during runtime.
VB.Net allows editing of any source code.
Shades of Beautiful
As colored crayons, when in my hands,
Draw the mind’s delight,
So, without hold, my love unfolds,
…When you are in within sight.
These colored sticks of creativeness
Unwind and scatter here
Upon this page, this flattened stage
On which I will draw you clear.
In this endeavor I must be clever,
And elect colors with care,
For if I do then I’d capture you,
…From brush to page through hair.
..Your lips, your hips, your fingertips,
…And half-unbridled smile…
Without constraint, and never faint,
…Your all-alluring style.
You’re fourteen shades of lovely,
With two shades of divine,
Sixteen shades of beautiful,
And every shade is mine.
And from each color, comes another
Shade to paint my world,
And with attention… detailed, I mention,
I watch it all unfurl.
Copyright 03-14-2003 Joshua R. Mouch
Go to Definition (+1 VB.Net)
It seems that C#’s “Go to Definition” is incapable of navigating to a VB.Net source file. Instead, it just takes you to a meta-data version of the file (without source code).
VB.Net does not have a problem navigating to C# code.
Find Definition (+1 VB.Net)
I use find definition quite a bit to quickly jump to a method or property definition. Just hit F12, and you’re there. However, C# adds an additional step. If a method is overloaded, it will pop up a “Find Symbol Results” window, and ask which overload you would like to go to. VB.Net infers which you would like to go to based on the parameters that are being fed to the method, therefore removing that step.
Creating Blocks (e.g. Classes, Methods, If…Else, etc.) (+10 VB.Net)
Both VB.Net and C# have automation built in when it comes to creating blocks. However, C#’s implentation is quite a bit less robust.
Creating a new block
VB.Net
To Create a new class, method, and property in VB.Net, you could type:
public class TheClass<enter>
public property TheProperty as string<enter>
<down><down><down><down><down><end><enter>
public sub TheMethod<enter>
Result (including important cursor positions):
Public Class TheClass
Public Property As String
Get
|
End Get
Set(ByVal value As String)
|
End Set
Public Sub TheMethod()
|
End Sub
End Class
C#
To Create a new class and method in C#, you could type:
public class TheClass {}<home><enter><up><tab>
public String MyProperty {}<home><enter><up><tab>
get {}<home><enter><up><tab>
<down><enter>
set {}<home><enter><up><tab>
<down><down><down>
public void TheMethod() {}<enter><home><enter><up><tab>
or (using shortcuts)
public class TheClass {}<ctrl-enter>
public String MyProperty {}<ctrl-enter>
get {}<ctrl-enter>
<down><enter>
set {}<ctrl-enter>
<down><down><enter>
public void TheMethod() {}<enter><ctrl-enter>
Result (including important cursor positions):
public class TheClass {
public String MyProperty {
get {
|
}
set {
|
}
}
public void TheMethod() {
|
}
}
C# Inconsistencies
If there is a syntax error (e.g. unclosed block) near the new block, it will not be auto-completed or auto-formatted.
Comparison
Luckily for C#, <ctrl-enter> exists. Otherwise, you would have to type <home><enter><up><tab>. However, it took me a while to find this shortcut and get used to using it.
Without the shortcut, there are 6 extra keys to hit. With the shortcut, there are only 2 extra keys plus a combo key instead of just enter (so 3 extra keys).
On top of the extra keys in C#, you must make sure all the syntax is correct or else auto-complete will not happen.
Auto-formatting of existing blocks
This is where C# really shows its inferiority. Once stuff gets moved around, the only way to get back to standard formatting is to make sure there are no syntax errors and then hit <ctrl-K><ctrl-D>. Well, that or manually move it… but are we using an IDE here or Notepad?
There are lots of reasons this C# will not auto-format your block for you even after hitting <ctrl-K><ctrl-D>. For example, if a previous block is unclosed, or if there is a syntax error somewhere nearby, such as missing a ‘;’ inside the block.
Feelings on the Matter
I find myself constantly hitting <ctrl-k><ctrl-d> (shortcut for format document) while programming in C#, since the formatting of the document becomes non-standard after a bit of editing.
Basically, VB.Net’s philosophy is: auto-format all the time, unless you are talking about a line continuation (using an underscore character).
C#’s philosophy seems to be: auto-format only when finishing a block and there are no syntax errors to speak of nearby.
The C# versus VB.Net debate in a Slightly Different Light (I Hope)
The C# versus Visual Basic.Net debate has been an ongoing one since the inception of the .Net languages.
Let me start off by saying that I am not so much concerned with the language/syntax itself as with how quickly I can finish my project using that language, and how good the code is afterward. I recently read a great quote: “Programmers don’t like to code, they like problem solving.” I could not agree more.
From a purely language/syntactical perspective, I can save you the trouble of reading this and tell you that it’s purely
Comments (1)
Comments (45)
Leave a Comment