Stories Tagged with 'C#'


Fun with C# Switches

Url: http://msdn.microsoft.com/library/default.asp?u...

Interesting what can happen when you re-read the specification.  I've been taking time in the "library" to read the 2.0 C# Specification. But instead of skiping the old stuff and concentrating on the new language stuff, I am reading the whole thing again. Something interesting I found in the 'switch' statement.

The C# Team seems to speak out of both sides of its mouth

Url: http://www.panopticoncentral.net/archive/2005/0...

I was reading an article about VB9's XML Literal support and why C# decided not to support it.  (Note, I agree with C#'s lack of support for it, but that's not what this post is about).  Paul Vick said:

Virtual + New is Evil? I am convinced...

Url: http://www.dotnetconsult.co.uk/weblog/permalink...

App.config and C# Projects (Updated)

Everytime I add a app.config file to a new C# App, it never does what I want. I want the app.config file to be deployed to the build directory so I can make changes to the app.config file and have it propogated. With the release of VS.NET 2003, us C# developers now have pre and post build steps. So I now have to remember to add the following to the post-build event:


xcopy /s $(ProjectDir)app.config $(TargetPath).config

I know I could write an "Add New Item" to make it happen, but I just haven't had the time. I just wish MS had done it for me.

Getting My Hands on the 64 bit Framework

I got to play with an Itanium 2 Box at the PDC today. Instead of following their script, I did what I've wanted to do for months...creating a huge DataSet. They had an interesting setup. You used a Pentium 4 box to develop code and then Terminal Service'd into a sixteen-way Itanium 2 machine to run the code. The 64 bit JIT's the IL to 64 bit code from the same assembly that the 32 bit JIT did to create the 32 bit code.

I say some interesting results:

Of Enum, FlagsAttribute and Enum.Parse

I found it very interesting in a little test that the Flags attribute doesn't seem to change the way that the CLR numbers Enumerations.  So that this enumeration:

public enum UnFoo
{
  Foo,
  Bar,
  Quux,
  Foobar
}

this code ends up not working as i'd expect:

Visual Studio Beta 3?

Url: http://lab.msdn.microsoft.com/productfeedback/v...

There is a suggestion up on the LadyBug site to support a Beta 3 of Visual Studio as some developers are worried about the quality of the Beta 2 (and I assume the CTP's as well).  If you have an opinion (I have one), please go there and Vote.  The sheer size of the votes will help Microsoft determine if it is a fringe group believes there are issues or whether a Beta 3 is really necessary.  Please make your opinion known!

101 Uses for Nested Classes

Url: http://www.windojitsu.com/blog/nestedclasses101...

Time Zones and Servers

Wonder-121-Time-Zone-Static-ImageI am getting married and that means I get a bunch of development tasks to do for the wedding planning. I guess it’s my own fault, I did propose with an app.

One of the tasks I had to do was create a new page on my wedding site for the day of the wedding to include things like directions and parking. Pretty simple HTML stuff, but one thing I wanted to be sure of was to only show the page on the day of the wedding. This should be easy, but the time zone of the server has kicked my ass before.

JavaScript for the C# Guy: The confusion about 'this'

As a C# guy I am comfortable with the idea of 'this' in the scope of a class (or 'Me' for your VB'ers). It's a relatively simple idea that allows you to access the instance of the class that you're a part of to call members.

In JavaScript that have a similar idea but because of the nature of JavaScript it can cause some odd behavior. Let's look at the standard behavior first.

JavaScript for the C# Guy: The Global Object

codeThis is another in my series about (hopefully) interesting JavaScript constructs that might surprise most C# developers. You can see others here: JavaScript for the C# Guy.

Back in the day I was doing some scripting in classic ASP sites (no, not classic ASP.NET) and we screamed and yelled about putting too much in the global scope. We wanted encapsulation and such and that is true today. In my C# work pretty much everything is in a class (static or otherwise) so I don't have to concern myself with it much.  But in JavaScript I know there is an easily accessible global object...but it occurred to me that I don't see the "Global" object accessed much; even though it is used a bit (to hold other containers that have encapsulated code). "Why not?" I wondered.

JavaScript for the C# Guy: Scopes

roach

Another day in JavaScript land for this  C# guy. I am reading the excellent Professional JavaScript for Web Developers and I am finding more and more that separates the two languages. I know everyone will mention it, but I did read JavaScript: The Good Parts and I liked it but it isn’t as comprehensive as this book.

JavaScript Function Scopes

As some of you know, I authored a Pluralsight course on JavaScript for C# Developers. We’ve released an excerpt from that course covering how JavaScript function scopes work.

If you’re just getting started learning JavaScript, it can be easy to bring your C# biases to the language since they both have curly braces. Hopefully this excerpt will help:

Microsoft Announces Source Code Analysis for C#

Url: http://code.msdn.microsoft.com/sourceanalysis/R...

Interestingly, Microsoft has released a new tool that they've used for years internally to analyze code in their code base.  Its been informally called "StyleCop" and differs from FxCop in that it analyzes source code, not compiled binaries. 

Speaking at the Atlanta Code Camp

Url: http://www.atlantacodecamp.com

This weekend I will be at the Atlanta Code Camp this Saturday. I have four talks and they follow the predictable Silverlight and Data topics. Here are the talks:

Using Closures to Simplify Asynchronous Programming

Url: http://wilderminds.blob.core.windows.net/downloads/asynchronousclo...

When I teach Silverlight, some of the students lament at the requirement to make all network requests in an asynchronous manner. While I explained my opinion on the manner back in March of this year, I didn't get into how to make this easier. Lambdas and closures are the key to simplifying that code in my opinion. 

My First ScriptCS

I’ve known Glenn Block for a long time now and I’ve heard about the ScriptCS project he’s worked on for a long time. I’ve never had time to dig in until now.

For the uninitiated, ScriptCS is a scriptable environment that uses .NET and C# for it’s platform. It makes writing simple scripts easier if you know C# already. It has support in several different editors, but I’ll talk about how I used it with Visual Studio Code since that’s my new favorite toy.


Application Name WilderBlog Environment Name Production
Application Ver 1.1.0.0 Runtime Framework .NETCoreApp,Version=v1.1
App Path D:\home\site\wwwroot Runtime Version .NET Core 4.6.25009.03
Operating System Microsoft Windows 6.2.9200 Runtime Arch X86