Introduction to .Net

sweetleafapartInternet and Web Development

Aug 7, 2012 (4 years and 10 months ago)

357 views

Keith Elder

Microsoft MVP

http://keithelder.net/blog/

It’s the new wave…man…..

Abstraction from
low level
programming

Imagine you had to write programs
in Assembly today? Thank
goodness we’ve moved on!


Languages in
.Net

are written in
what is called Managed Code. This
means the code you write is
“managed” by another
intermediate process therefore
increasing productivity.


An unmanaged code example is
programming in C where the
developer is managing all of the
memory, security, exceptions, etc
in their program.

Choice of Language


Supports 44 different languages

Cheaper Maintenance


.Net



Windows includes free application server IIS


Java


Requires server OS plus additional application server
(BEA,
Websphere
, WebObjects)

One platform to rule them all

Extensive APIs


Increased
Productivty


Base Class Libraries


System


System.CodeDom


System.Collections


System.Diagnostics


System.Globalization


System.IO


System.Resources


System.Text


System.Text.RegularExpressions


Framework Libraries


System.Xml


System.Data


System.Security


System.Web


System.Drawing


Simple Deployment

Scalable Architecture

Huge Ecosystem

The Coolest IDE
Evar
!

Let’s get the money thing out of the way.

Myth Busting

.Net

Cost:
$0.00

.Net

has been freely
available for the Windows
platform since the
beginning.


Visual Studio is the tool of
choice of
.Net

developers. A
free version is available
called Visual Studio
Express.


An open source version of
.Net

called Mono is freely
available which allows
.Net

applications to run on Linux
and Mac OSX.

What is
.Net
?


A free language agnostic platform for building
applications:


Windows


Windows Mobile


Smart Clients


RIA (rich internet applications) /
Silverlight


Web Services


Outlook
Plugins


Workflows


*Unix (through Mono)

What is
.Net

Under The Hood?


A base collection of libraries


Mscorlib.dll, System.dll,
System.core.dll


Framework libraries


Ado.Net
,
Winforms
,
Asp.Net
, LINQ, WPF, WCF, WF


A collection of utilities


Wsdl
,
WcfTestClient
, Web server,
ngen
,
MSBuild


What is
.Net

Under The Hood?


Compiler(s)


Currently
.Net

supports 44 programming languages


Common Language Runtime (CLR)

What Does the CLR Do?


Memory Management


Thread Management


Garbage Collection


Security


Exception Handling

From Your Code to the CLR

Start with some code (C# Example)

Compile It using the C# Compiler
(csc.exe)

Result of Compilation: CIL

Putting It All Together

C:
\
Windows
\
Microsoft.NET
\

A Collection of Libraries

More than one version of
.Net

can be installed at the same
time. The Global Assembly Cache (GAC) makes this
possible. (C:
\
windows
\
assembly )

Just a bunch of DLLs

These are the
majority of the
System*.dll files
located in the
v2.0 version of
the framework.


These DLLs
make up the base
class libraries
and the
framework
libraries.

What is a DLL?


Dynamic Linked Library


A file that contains:


Code


A collection of classes


Data


Resources


Images, Bitmaps, Icons, Settings, XML, etc


DLLs have versions


1.0.0.0


DLLs also have meta information


Who wrote it, copyright etc (right click a DLL in explorer and hit
properties then click on the details tab)


.Net

DLLs can be disassembled once compiled


Reflector


DLLs can be written in one language and used in another


How are DLLs Created?

Programs Can Reference One Or
More DLLs

The
MyLibrary

project is a DLL that we can reference in our console
application. As a matter of fact, ANY program can reference our
MyLibrary.dll. You’ll notice from the screen shot above our console app
is referencing other DLLs as well. DLLs allow programs to share large
amounts of functionality without having to worry about single files.

Our Program using
MyLibrary

Compiling our
Program.cs

to a DLL

csc

/
target:library

Program.cs

Pointless but we can!

Where is
.Net
?

The GAC

Reflector

Learning
.Net


Pick a language and stick with it.


Recommendations


C#
-

if you know C, C++, PHP, Java or other curly brace languages


VB.Net



if you have a lot of VB6 programming


F#
-

functional programming language, it is new, coming in VS2010, should start
exploring it now


Learn a new language every year. By the time you retire you will have covered most of
the languages
.Net

supports!



Learn a new technology every year.
.Net

has plenty to keep you busy for at least a
decade or two.


Focus on the following Namespaces within the framework


System


System.Data


System.Xml


System.Linq


MSDN Virtual Labs, Channel9, Blogs, Conferences, local
Codecamps
,
.Net

User Groups, Books (Safari)

Information Overload

The
.Net

platform is
huge.


You will hit
information overload,
focus on what you will
use day in and day out.
Everything else is just a
search away.


Links


.Net

Framework on MSDN


http://msdn.microsoft.com/en
-
us/netframework/default.aspx



Base Class Libraries


http://msdn.microsoft.com/en
-
us/netframework/aa569603.aspx



Virtual Labs


http://msdn.microsoft.com/en
-
us/virtuallabs/default.aspx



Finding Local
.Net

Groups


http://communitymegaphone.com/



Conferences


MIX (web programmers), Tech Ed, PDC,
DevLink
,
Codemash
, VS Live, Dev Connections, and more


Code Camps


http://www.dayofdotnet.org



Safari Online


http://safari.oreilly.com/



Visual Studio Express


http://www.microsoft.com/express/



Mono


http://www.mono
-
project.com/Main_Page



Blog


http://keithelder.net


Podcast


http://deepfriedbytes.com