Starting .Net
Posted on 20 Dec 2005 at 11:53
In a new Real World column, Thomas Lee will be covering Microsoft's .NET platform as it affects IT professionals
The installation program for the .NET Framework and the SDK writes an information event log entry to the computer's Application Log after completing the installation. For a successful installation, this entry's Source will be MsiInstaller and the Event ID will be 11707. Note that this is a generic MSI Installer success event, and you'll need to look at the Event Description to check that it was indeed the Framework or the SDK that was installed. Similar event log entries are written by MSI if you remove these packages, the event ID then being 11724.
If you plan to install either or both of these packages using a Software Distribution Group Policy object, first extract the relevant MSIs using the /T and /C switches to a temporary folder. DOTNETFX.EXE expands into INSTALL.EXE, INSTMSI.EDE, INSTMSIW.EXE, NETFX.MSI and NETFX1.CAB and, in most cases, you'll need to deploy the last two of these.
Most serious developers are probably going to want Visual Studio on their computers. While you *don't * have to buy and use Visual Studio to create .NET applications, it is pretty much the best development tool in the business, and it really does contribute a lot to developer productivity. But it's not free.
The .NET Frameworks ships with both C# and VB.NET command-line compilers, which means you could use Notepad (or your favourite programmer's editor) to create your source and then compile it using the command-line compiler CSC.EXE or VBC.EXE. In future articles, I'll be looking a bit deeper at the built-in development tools in the SDK and framework, and some of the examples in this column are ones you can compile using these tools.
When you compile some .NET source code, the compiler produces output similar to that from a conventional compiler: you can compile to either a DLL or to an executable. In Figure 2, you can see the results of compiling and running the following simple 'Hello World' program written in C #:
using System;
public class HelloWorld
{
public static void Main()
{
Console.WriteLine("Hello World");
}
}
This is a simple .NET program that just displays the traditional greeting on the command line. Figure 2 shows the source file HELLO.CS and the compiled output HELLO.EXE. If you can compile this source file and run the program, you've got the .NET Framework loaded. A question I often get asked is whether administrators really need to be able to write code, and I answer that these days it certainly helps - with lower-level API tools like WMI and ADSI, being able to write scripts in C# or VB.NET (or any other .NET Language for that matter) is very useful.
One thing to remember: the Framework and SDK tool folders aren't automatically added to your Path statement, so you'll need to deal with this - adjust the Path variable from the Environment Variable dialog in System Properties.
So What's The Big Deal?
The HELLO.EXE in Figure 2 doesn't look anything special, just like any old unmanaged application, so what's the big difference? We need know a bit more about how .NET programs run. In the .NET world, the output of the compiler is known as an Assembly, which contains a Manifest (metadata about the assembly), the MS Intermediate Language code representing the application itself, and optionally any resources that the application might need, such as a bit map or font. As explained above, .NET language compilers emit an intermediate language (MSIL) rather than native machine code that can be directly executed as a conventional C compiler does. This MSIL gets compiled at runtime by the JIT compiler (or Jitter) into machine code executable by the target computer's CPU. The assembly's manifest contains details like what classes are defined in it, and their detailed module identifiers. This metadata, also known as evidence, can be used at runtime - by the security subsystem, for example, to enforce code access security.
advertisement
- Getting to grips with Microsoft's IT Health Environment Scanner
- Virtualise your servers
- The changing face of travel gadgets
- Build your own distributed file system
- The bulletproof Dell that costs an arm and a leg
- Microsoft Office 2010 Technical Preview: Q&A
- Lawnmowers, the TyTN II and one odd insurance request
- There'll never be a bulletproof OS
- How far can we trust apps?
- Five nice touches in Outlook 2010
- ATI Radeon HD 5970: 42% more expensive in the UK
- Office 2010 Beta – 32-bit or 64-bit – The Choice is Clear
- Why Britain's watchdogs have fewer teeth than goldfish
- Tabbed documents: how to make Office 2010 great
- Outlook 2010 People Pane – does it spell death to Xobni
- Microsoft Outlook 2010 screenshots
- Co-Authoring in Word 2010 and SharePoint Foundation 2010
- Microsoft Outlook 2010 screenshots: Backstage view
- Flash 10.1: Developing for Desktop and Device
- Microsoft Office 2010 screenshots: Recover unsaved items
- Sky Player shows up in Windows 7
- Tweetlevel reveals most influential Twitterers
- Apple "refuses to repair smokers' Macs"
- Spotify arrives on Symbian
- Chrome OS and Android to "converge over time"
- Microsoft to pay News Corp to stay off Google
- Christmas sales surge knocks out eBay search
- Windows 8 set for 2012 release
- Q&A: Why Conficker was a victim of its own success
- App developers losing faith in Android
advertisement
Printed from www.pcpro.co.uk


