Hi Friends – if you are in Delhi on 27th Sept and want to share ideas, knowledge and just have fun with your peer technologists please do come for the Community Tech Day. I will be there too and would love to meet you!
Register at www.communitytechdays.com - it's FREE!
Microsoft recently donated code to Apache Foundation’s Stonehenge project which aims at demonstrating real world best practices for building SOA based systems and achieving application interoperability.
You can find the complete source code for the sample application called the .NET StockTrader here.
I recently got a question - "While developing applications in ASP.Net what is the difference with or without SOA architecture?". i thought - it is quite an interesting question and something I should write a post on.
First things first - what is SOA? why do we need SOA? what are the advantages of SOA?
Service Oriented Architecture - it is an architectural paradigm that advocates building enterprise systems (usually distributed but not necessarily) from and based on web services (although it is allowed and possible to build a SOA system using alternatives like COM/CORBA). Why web services? One - webservices can be developed using any language and hosted on any platform. Two - web services can function over most protocols including HTTP, which makes it easier to access them from anywhere. Three - web services interact with each other by exchanging messages in a mutually agreed format called "contract" defined in a service description.
In a services based system (i am deliberately not using the word architecture here) - there is a requestor (another service, system or application) that sends a message to a provider (a service) and gets a response with the required information - processing it as appropriate. Most important differences between a service and any other modularised code entity is that a service is:
- usually Atomic
- granular (chatty)
- always confirms to a contract
- responds only to a valid message
- is asynchronous to account for the network latency and handle concurrency
- always has a way to handle error conditions (esp rollback partial errors)
With these properties in mind, architects designing services usually keep in mind the following:
- The requestor can be any other system, running on any platform
- The requestor should be able to discover the service, find out the way to communicate with the service, send a message to the service, get a response and be able to process the response.
Now, why do we need SOA? - till now nowhere have i mentioned that the provider needs to have any knowledge about the requestor (other that the information that it needs to process the request from it - if any), the requestor can be any thing - another web service, a client desktop application, a web application. Web services can be created to address needs at any of the layers of a n-tier application. So - you may have a set of web services that are responsible for accessing and fetching the data from the database server, another set of web services that provides the business logic, a set of web services to create a presentation layer. You can knit them together to construct your application - adding the necessary glues be it the UI, validation or other things that are not available as services - or implement these functionalities as services if it makes architectural sense in a given scenario.
This leads us to the benefits of using SOA - in scenarios where you predict extensive interaction/integration between various applications (be it multiple application within the same organization or different applications running on different platforms in different organizations), or where you may need to scale in the future to address the growing customer needs, or when you want to have a choice of different types of clients (web, desktop, mobile) using the same back end services, or when you plan to keep the option of migrating to services provided by different vendor without having to change your whole application or being able to change/enhance a service without disturbing existing applications - SOA offers a huge set of benefits by providing loose coupling, platform neutrality, standards based implementation, rigid contracts for version independence etc.
Now - coming to the actual question - what is the difference in developing an ASP.NET application with or without SOA? So if you are looking forward to gain from any of the advantages of SOA mentioned above, if you are planning to integrate multiple applications, provide access to multiple clients, reuse and manage functionality/services across multiple departments in the same organization, provide an easy interface for your customers/vendors to integrate with your systems - SOA definitely is the way to go. One important thing to remember here is - SOA is independent of ASP.NET. You can build a complete services facade comprising of all the functionality that you need and then weave them together by using ASP.NET as a glue and provide the web UI in it. At the same time - the same web services can be accessed by other clients (internal or external customers/vendors) be it web, desktop, mobile or just another service. In most cases - if you are planning a new system and do not have to carry forward legacy code/systems, SOA is a safe bet unless you have a small simple system which would not be need to integrate with other systems, in which case SOA might be an over kill.
All in all - SOA does have to offer a huge set of advantages especially for Enterprise Applications - given that they can have multiple systems from multiple vendors and may have the need to integrate with legacy systems - to provide a seamless unified experience to the users.
Every body is talking about Azure - Microsoft's Operating System for the cloud. How can i not write something about it? After all i was there during the unveiling of this paradigm changing strategy was done by Ray Ozzie at PDC. Read the transcript of Ray Ozzie’s keynote or watch the video to know more.
So what is all this about? Azure, Cloud OS, .NET Services, Live Services and tons of other stuff? Let me try and paint the picture.
Let's first look into what is an Operating System (OS) all about? If anyone who is reading this post is old enough to remember the days when you have microprocessor devices without any operating system on them you will understand how the OSes have changed the world of computing - how they have made computing so much more accessible and useable by the common man. Let’s imagine what would a device without an operating system be like? Suppose you had to just copy a file from one location to the other. You would potentially have to do one or more of the following things. write a program in the instruction code of that particular processor that would instruct it to first 'mount' the source drive (assuming that the source hardware is plugged and understandable by the processor), 'mount' the target drive, tell the processor where is the beginning of the source file (location of the sector, block etc) and tell it the location where it should begin writing on the target, tell it the memory location where it will keep the read contents temporarily and its size, and then issue the machine instruction equivalent to writing the bits on the drive. It could be fairly more complex than this. Today we hardly recognize the complexity of all this when we issue the "copy" command or "drag and drop" the file from an usb drive to the hard drive. Why? Because the OS abstracts all this complexity for you! Disk Operating Systems were an important phase in the evolution of OSes - meant to abstract the complexity of creating, copying, deleting, managing files and disk input outputs in general they soon evolved into more complex and capable systems - managing other peripherals, memory, applications, drivers, etc for you and giving you an easy to use interface where in you can focus on working on your problems (be it writing code, word processing, data analysis) rather than having to deal with the internals of the machine or the processor. OSes laid the foundation of the rapid evolution of computing allowing a common person to use computers and get benefit out of it.
This is something that an OS running on our personal computers does. The common tasks that we expect a PC OS to perform include - managing memory, disks, peripherals, display, user interface, runtimes of software etc... Lets now take a step back and imagine if you were to build an OS that would run on a remote machine, which would be accessible to anyone in the world, allowing you to put your applications on it, run them, make it available to anyone in the world - what would be functions that would be expected from such an OS? What modules would it need to take care of all the possibilities and the scenarios that arise in the cloud so that is minimizes the complexity for the end user in the same way that the PC OSes have done? To bring the problem closer to a real scenario - lets add one more level of complexity - since it is not possible to have one big computer with enough computing resources and memory to address the needs of everybody in this world - it is obvious that the remote machine would actually be a complex cluster of thousands of machines/servers, raid drives and other resources. Now this OS that you are embarking to build would in effect be a sort of a mega-OS, an OS to manage thousands of OSes running on these thousands of machines (also in a virtualized environment). So what would be expected out of this mega-OS? Apart from all of the functionality that is provided by a common OS - it would need to make sure that if there is a failure of any of the OSes running on any of the machines, or if any of the machines goes down, or if the resources on any of the machine is falling short of requirement, or if new machines/OSes are added or pretty much anything to manage the possibilities in this huge cluster of machines that would almost be like a black box to the end user. To add to it - managing multiple users, their identity, their data, transactions, maintaining throughput etc...
This is exactly what Microsoft's OS in the cloud - Azure is all about. Azure is an Operating System that runs on the a huge cluster of servers located in multiple places across the world and is exposed to the users by way of various services (.NET Services, Live Services, SQL Services, Sharepoint Services, Dynamic CRM services) - such that they no longer have to worry about hardware, memory, load, electricity bills of data centers, maintenance, replacement, scaling the hardware and resources as their business grows etc. All they have to do is build their applications for Azure (almost in the same way as they did for Windows running on their customer's box with the additional task of keeping in mind the best practices and patterns for building effective and efficient cloud applications) and host them on the Microsoft data center running on Azure. Azure in the background will take care of ALL the underlying complexities of deploying it on one or more machines, load balancing, recovery form failure, guaranteed availability and other issues that are relevant to the cloud making your application immediately available to millions of Internet users.
Remember the impact that .NET had on the way we develop applications for the Internet? Imagine writing a webservice in native code, deploying it and testing it. Compare it to doing the same thing in .NET. I believe Azure is going to bring the same kind of revolution in the world of computing. The ease with which you can develop an application using traditional programming knowledge and tools like Visual Studio and host them in the cloud running on Azure and forget about the rest is simply phenomenal and anybody who has an eye on the future cannot ignore this.
This was a post intended as a primer into Azure. In the subsequent posts I plan to delve deeper into architecture of Azure, tools for Azure development and building your first Azure application. Keep a watch…and if I do not post soon…leave messages to force me to do so..:)
For a longtime customers have been requesting us to provide Hindi language support on Windows Mobile. Without going into the technicalities of why it was not available, I would like to say that finally the gap has been filled. One of the Microsoft Partners have finally implemented a FREE Hindi font engine for Windows Mobile 5 and Windows Mobile 6. Presently this is available only for touch screen phones. Once you install the engine - you will be able to enter data in Hindi, view text in Hindi from Hindi websites and develop applications in .NET Compact framework which have text and labels in Hindi.
You can download and install it for free from http://www.eyron.in
Thank You Eyron Team!
I recently wrote a white paper on the approach and the things that need to be considered while developing .Net applications that support multiple languages - both in terms of accepting the user input and also displaying resources. I am putting it up on my blog for consumption by all. Please let me know if there is something i missed.
Virtual Tech Days day one, session one. I delivered a talk titled "know your tools better". Firstly, thanks to all those who attended the talk. Thanks for having keeping patience inspite of the audio and video issues we faced. Due to lack of time i could not cover some things that i wanted to share and also could not take up questions. I had saved all the questions that were posted over live meeting and i will address them in this post.
Q1) How do extension method really work? Please show an example on using Extension methods
Extension methods are defined as static methods inside a static class. When the compiler comes across a call to Extension Method, it replaces the calls with corresponding instance method invocation of the static class.
Some facts about extension methods:
- Extension methods have lower precedence than instance methods. i.e if there is an extension method with the same signature as an instance method - it will be ignored by the compiler.
- Extension methods need to be defined in a non-nested static class
- The first parameter of the extension method starts with a keyword this which defines that this extension method will be applied to the type that immediately follows this keyboard.
- Extension methods cannot access private members of the class
Q2) What is a partial class
Partial classes allow you to divide the code of a single class into multiple files. You can define them using the keyword 'partial'. You can apply the partial keyword to a class, struct or interface.
Q) If there is any unused "Using System.Linq" in the code, will this affect the performance of the application or any drawback or so.
A) No. the compiler knows how to optimize and remove all unused references from the code during compilation - so there will be no runtime impact.
Q) I think the shortcut for inserting snippet is present in VS 2005
A) Yes.
Q) ctrl + d combination is not working. will i have to enable anything ?
A) Should work. You don't have to enable anything. When you press ctrl +d in visual studio - it should take the cursor highlight into the find box. You can notice it being highlighted.
Q) Where to get these Code Analysis results?
A) right click on the project. You should see a 'run code analysis' option (5th in my case). Click on that. To see the results goto the Error List (you can enable it from the view menu or ctrl+\, ctrl+e). There you will see all the code analysis warnings (in CAXXXX format where XXXX is the error code). These warning give a lot of information about potential loop holes in the code. To get more information/help on each of these errors, what it means and how to resolve, select it and press F1.
Q) Run code analysis will be available for C#?
A) Yes
Q) Is the Run Code Analysis menu option available in VS2008 or do we need to install VSTS for the same?
A) Unfortunately, Code analysis is not available with professional edition. You will need VSTS for it. Alternatively, you can use FxCop which is a free utility from Microsoft to do a similar analysis separately. You can download FxCop from http://www.microsoft.com/downloads/details.aspx?FamilyID=9aeaa970-f281-4fb0-aba1-d59d7ed09772&DisplayLang=en
Q) What is a formula to calculate maintainability Index for whole Project?
A) you can get detailed information about the maintainability index at: http://blogs.msdn.com/fxcop/archive/2007/11/20/maintainability-index-range-and-meaning.aspx
Q) Can we set the build configuration at the solution level
A) Yes. When you open the Configuration Manager - you will see all the projects in the solution listed there. You can set the build for each of these separately.
Q) what was the command that you ran now in the immediate window?
A) You can get more details about what you can do in the immediate window here: http://msdn.microsoft.com/en-us/library/f177hahy.aspx
- During the demo i had loaded the sos extension dll from the immediate window by typing ".load sos" and run commands from it which help you to debug managed applications. You can get more details here: http://msdn.microsoft.com/en-us/library/bb190764.aspx
Q) Can you copy the short cuts Poster url in the QA Pane
A) C# key board reference poster : http://www.microsoft.com/downloads/details.aspx?FamilyID=c15d210d-a926-46a8-a586-31f8a2e576fe&DisplayLang=en
VB key board reference poster: http://www.microsoft.com/downloads/details.aspx?FamilyID=6bb41456-9378-4746-b502-b4c5f7182203&DisplayLang=en
Q) What is the difference between "Build" and "Rebuild"?
A) When you choose "Build", Visual Studio only compiles and links the portions of the assemblies that were affected by the changes since the last build. "Rebuild" - recompiles and links the complete project/solution again. "Rebuilds" can take more time for big projects.
Q) Why there are pdb files for a release mode build?
A) A lot of times there are issues that may happen only in the release build (e.g. due to optimizations or link sequence etc.) and may never happen in debug builds. So after an application is deployed and there are issues with it that do not happen in debug builds or cannot be reproduced on any other machine, there may be a need to debug the release build or debug on the production machine. In such cases symbols for the release build are very helpful. You may however not distribute symbols of the release build to the customer and just keep them in the repository for your debugging purposes.
Q) What are the symbols in the debug and release?
A) Symbols are usually stored in pdb files. They contain information about variable names, source file lines etc which are very helpful for debugging. You can create symbols for debug and release build both.
Q) Are these editor functionality available for XAML also?
A) A lot of the functions are available in the XAML editor also (see the edit menu). Also check out the features that specifically apply to XAML (Edit->Advanced, Edit->Outlining. Even ctrl+d, clip board ring (ctrl+shit+v) and most of the other short cuts that do not apply to code particularly work in XAML editor.
Q) I want to know more about the .Net tools
A) This is one thing i could not delve upon during the VTD. I had planned to talk briefly about (and other stuff if i got time):
Q) How can we clear the buffer for ctrl+c?
A) don't know. I tried to find - but could not.
Q) How do I access the registry from code on Vista? Since each time it tells me access denied.
A) Check out this wonderful link: http://www.microsoft.com/downloads/details.aspx?FamilyID=BA73B169-A648-49AF-BC5E-A2EEBB74C16B&displaylang=en
Hope i have been able to address your questions. Please let me know if i missed any question or if you have follow up questions.
Hi Friends! In about 45 minutes from now i will be delivering the first session of the VTD on Know your tools better: tips and tricks on how to enhance .NET development using VS 2008 and other tools and at 3:45 IST i will be talking on PLINQ: Parallelize Your .NET Applications with Parallel Extensions. Please do join in if you have time - i promise you will learn something new from both the sessions.
To know more about how you can join go to www.virtualtechdays.com.
If you attend i encourage you to give us your feedback.
If you wish to tell me something or need more details on any of my sessions please feel free to leave a comment on the blog. I will respond to them individually asap.
Thanks Anand! Sorry for stealing the title and idea of your post.
It was this post from Anand that inspired me to ask the same queston to the Indian developers community. As Anand mentioned - we do a lot of work in trying to give to the community whatever we can. Things sometimes seem going good and sometimes not so good - we get feedback for our sessions and talks but that hardly tells us what we need to change - what are the things that people want to hear or know.
When we go outside - we see people are really passionate about Microsoft technologies - many a times they challenge us to think ahead and out of the box. Many people ask very tough questions, but rarely do we get to hear what are the things they want to hear from us. India, has the second largest developer population in the world and it is important for us as evangelists to give them what need and not what we want to tell them - to make them more competitive and to help them make a difference.
So if you have any feedback, ideas, suggestions on what can we do to make a bigger impact please do share it with us. Help us help you.
my sincere thanks in advance.
Bijoy
What is the difference between XBAP and Silverlight and when should i use which of these technologies?
Let me step back and start with a precursor:
In .NET 3.0 we have Windows Presentation Foundation (WPF) which allows us to create stunning UIs for desktop applications using managed code. If you still haven't experienced the power of WPF check out the WPF applications here.
Now the logical question was "How can we take the same stunning experience onto the web" - the first step towards that was XBAP - XAML Browser Application (XAML is eXtensible Application Markup Language - an XML type markup to store the UI). XBAPs allow you to run Rich Internet Applications that look and function like WPF desktop applications. These XBAPs run inside the Internet Explorer in a separate sandbox to prevent applications from accessing resources on the local system. A restriction on XBAPs is that they need .NET framework 3.0 or higher to be installed on the client machine to run.
This is exactly what Silverlight is for. So if you want your application to be available on the internet and not dependent on the .NET framework, Silverlight is the way to go. Silverlight is a cross platform, cross browser plugin that allows you to run UIs defined in XAML inside the browser. Silverlight supports a subset of XAML as of now.
I hope this clarifies some of the doubts around XBAP and Silverlight. Feel free to leave questions if you have any.
Finally i have succumbed to the requests of putting this document online. I was figuring out a way to put this on msdn blogs since it does not allow me to upload files, when someone told me that i can use SkyDrive for this purpose. SkyDrive is amazing! So here is the .NET Learning guide, roadmap whatever you call it - essentially it is a document that contains answers to common .NET questions, quick references to resources and some facts about .NET. I would appreciate if you can give me feedbacks as to what else you would like to see in it.
Get it now...
I have been doing a demo of InkCanvas recently to demonstrate the power of WPF and a lot of people have requested that I put the code on the blog, so here it is.
1) Open Visual Studio 2008 create a new WPF project in .NET 3.5. Let call it DemoInkCanvas. I chose C#, you can do the same in VB.NET

2) You will get something like the following:

The inkCanvas control is not available on the toolbox by default, lets now add it – right click on the circled area and select “Choose Items…”. Select the “WPF Components” tab and choose “InkCanvas”

3) We are going to create a form filling application, where the fields can take handwriting and convert it to text automatically
4) Lets change the background color of the Grid to something darker

5) Lets Drag and drop two InkCanvas controls, two radio buttons (for choosing writing or erasing pen) and a button control (for submit) on the WPF form. Watch the XAML text getting added to the XAML view automatically.

6) Change the “Content” property of the Button to “Submit” and the Radio Buttons to “Erase” and “Write”
7) Lets run the application so far by pressing Ctrl+F5 and test the handwriting part by writing something with the mouse on the InkCanvas control

8) Simple so far…Now lets add some handwriting recognition code to the application so that whatever we type gets converted to text for further processing. We will create and place a hidden text box behind each of the InkCanvas control such that when the focus from the InkCanvas control is lost, the text recognition takes place and is shown in the TextBox instead. We will also write the code to store the Canvas control in an in-memory Dictionary object, so that we can replace it back when the mouse is over the text box, in case if you want to make changes
9) Lets add the MouseLeave event handler to the InkCanvas control in the XAML view. Watch the intellisense.

10) Since there is no existing event handler the IDE shows “New Event Handler”. Double click on it and the IDE automatically puts a new handler with a proper name

11) Lets do some coding NOW! Before that add the following reference assemblies that will allow you to add the handwriting recognition feature: IACore.dll and IAWinFX.dll
12) Add the using namespace statements for System.Windows.Ink and System.IO

13) Right click on the name of the event handler and choose “Navigate to Event Handler”. This will take you into the code behind file – Window1.Xaml.cs

14) Add a TextBox and a Dictionary object to the class:
TextBox overLayedTxtBox;
Dictionary<String, InkCanvas> storeCanvasContent = new Dictionary<string, InkCanvas>();
15) Add the following code snippet to the MouseLeave event handler:
private void inkCanvas1_MouseLeave(object sender, RoutedEventArgs e)
{
InkCanvas editBoxCanvas = (InkCanvas)sender;
//store the canvas control in a dictionary
//so that you can hide it once you have
//finished recognizing the text and place
//a text box instead
storeCanvasContent[editBoxCanvas.Name] = editBoxCanvas;
//instantiate the InkAnalyzer to do recognition
InkAnalyzer theInkAnalyzer = new InkAnalyzer();
if (editBoxCanvas.Strokes.Count > 0)
{
theInkAnalyzer.AddStrokes(editBoxCanvas.Strokes);
}
AnalysisStatus status = theInkAnalyzer.Analyze();
if (status.Successful)
{
overLayedTxtBox = new TextBox();
grid1.Children.Add(overLayedTxtBox);
overLayedTxtBox.FontSize = 20;
overLayedTxtBox.Name = editBoxCanvas.Name;
overLayedTxtBox.Height = editBoxCanvas.Height;
overLayedTxtBox.Width = editBoxCanvas.Width;
overLayedTxtBox.Margin = editBoxCanvas.Margin;
overLayedTxtBox.VerticalAlignment = editBoxCanvas.VerticalAlignment;
overLayedTxtBox.Text = theInkAnalyzer.GetRecognizedString();
overLayedTxtBox.MouseEnter += new MouseEventHandler(overLayedTxtBox_MouseEnter);
overLayedTxtBox.Background = Brushes.PaleGoldenrod;
overLayedTxtBox.Visibility = Visibility.Visible;
editBoxCanvas.Visibility = Visibility.Hidden;
}
else
{
MessageBox.Show("Recognition Failed");
}
}
16) I have used the Analyze() Method of the InkAnalyzer, you may want to use the backgroundAnalyze() method and handle the events for more intensive asynchronous recognition. The GetRecognizedString method is the one that will retrieve the recognized text for you.
17) Notice the overLayedTxtBox_MouseEnter event handler – this is used to place the InkCanvas from the Dictionary object (storeCanvasContent) back inplace of the TextBox. Add the following code to the MouseEnter event handler:
void overLayedTxtBox_MouseEnter(object sender, RoutedEventArgs e)
{
//retrive the ink control back from the
//dictionary and show
//it again inplace of the text box
TextBox editBox = (TextBox)sender;
InkCanvas overLayCanvas = storeCanvasContent[editBox.Name];
editBox.Name = overLayCanvas.Name;
overLayCanvas.MouseLeave += new MouseEventHandler(inkCanvas1_MouseLeave);
if ((bool)radioButton2.IsChecked)
overLayCanvas.EditingMode = InkCanvasEditingMode.EraseByStroke;
else
overLayCanvas.EditingMode = InkCanvasEditingMode.Ink;
editBox.Visibility = Visibility.Hidden;
overLayCanvas.Visibility = Visibility.Visible;
}
18) The InkCanvasEditingMode properties – EraseByStroke and Ink let you choose whether you want to use the writing pen or the erasing pen
19) Build and Run the Demo – Enjoy….
PS: in case if someone wants the complete code sample, please mail me through the blog. I will send it across.
[edit: Aug 21, 2008]
Adding the demo in a zip right here - earlier when i wrote the post i did not know how to use Skydrive and then for a long time i seemed to have misplaced the code - finally here it is:
I recently got a question something similar to:
"We are having some memory issues when trying to run our .NET applications over Citrix. Since each user is running his or hers own session .NET Framework loads into memory for each instance of the application and this appears to hog the memory. Are there any recommendations when writing applications for these scenarios?"
Here is my response. I felt that this could be useful to lot many people:
The .net framework is loaded into a process for each application separately. The design does not allow sharing of the framework resources between processes. So if there are multiple processes running – there is going to be hit. However there are some practices that can help improve performance:
- Try and use Application Domains in the application – these will allow you to dynamically load dlls that are needed at a time into an application domain and when you are done – unload the application domain to conserve the resources.
- If the performance hit is substantial during the initial load of the application – try using NGEN to pre-jit the assemblies.
- I would recommend using a profiler (visual studio team system has one) to profile the applications and see what are the bottle necks – possibly minor tweaking in a few areas can give you significant improvement
- Possibly re-architect the application such that you have one server process that uses the framework and other parts of the application remain light weight and communicate with this server process – this is just a thought – it most likely is not going to be easy or feasible and would depend on the application and its functionality.
Q) I have built an exe out of my .net 2.0 application. Do I need .net framework on the deployment machines? Even if it is yes, can I make it independent to run on windows platform without .net framework because I don't want to install .net framework just for this single exe to run. My client has 200 machines and he cannot install .net framework in the all machines, the plan is he just calls the exe from the shared network path.
Yes – you will need .NET framework on the target (deployment) machine to run your .NET exe. What OS is there on your client machines? In most likely hood installing the framework should not be an issue as they can do it through sms updates. If you want multiple clients to access your application without having to install anything on the client machines, I would recommend going for a different architecture e.g. an intranet application – thereby running the app on a server and having the client machines access the functionality through the browser. If you are concerned about the richness of the User Interface – you can probably look at other new techniques like Silverlight or XBAP. If you do not want to use .NET 3.0, the same can be done by using the Click-once technique (read here), but again these would need the framework to be installed on the client (except in case of Silverlight – where you will need to install the Silverlight runtime which is about only 1.5 MB in size).
Q) Like ildasm for MSIL code what tool can be used for COM components.
MSIL is an intermediate way of representing code in High Level Language. The MSIL is embedded into the PE file as text, so tools like ILDASM and Reflector can parse that information and read it. Whereas COM components (dlls) are regular binary files stored in PE file format. The contents are not readable. However there are certain tools that allow you to extract different types of information from a COM dll e.g.
OLE/COM viewer allows you to read the information about the Interfaces and methods exposed from the COM dll or typelib; It is a part of the Win platform SDK and you can search for it by the name of the exe file oleview.exe. For more information read http://msdn2.microsoft.com/en-us/library/d0kh9f4c(VS.80).aspx
Dumpbin allows you to extract all sorts of information from a dll/exe – search for dumpbin.exe on your machine – it is again a part of the Win platform SDK and also ships with Visual Studio
You can use tools that read the PE file format to gather more details from a COM dll e.g. PE Explorer
All these would need indepth understanding of the binary file format and COM technology.
Q) What is/are the basic thing(s) that we require to execute a .Net application on client machine?
Install the corresponding version of the .NET framework on the client. You cannot install individual components of the .NET framework separately. The .NET framework is free and can be downloaded from:
.NET framework 1.1
.NET framework 2.0
.NET framework 3.0
.NET framework 3.5 Beta 2
Q) Has the .Net framework has been implemented using COM technology?
COM is a technology that was designed to help build distributed applications and address dll deployment issues. It is a native technology (i.e. COM applications are written using pre-.NET concepts). Just like .NET does make use of native stuff internally, it would also make use of the COM technology in some areas. But it would be wrong to say that .NET framework is built entirely on COM. .NET is a paradigm shift in terms of architecture and programming concepts.
There were a lot of question on good reference material for .NET (books and online). Here is a consolidated list of resources I am aware of. If anyone knows of more stuff – please do feel free to suggest in the comments.
CLR and JIT
- CLR via C#, Second Edition (Pro Developer) By Jeffrey Richter
Drill Into .NET Framework Internals to See How the CLR Creates Runtime Objects
http://msdn.microsoft.com/msdnmag/issues/05/05/JITCompiler/
NGEN
NGen Revs Up Your Performance with Powerful New Features
http://msdn.microsoft.com/msdnmag/issues/05/04/NGen/default.aspx
The Performance Benefits of NGen.
http://msdn.microsoft.com/msdnmag/issues/06/05/CLRInsideOut/
Garbage Collection
Garbage Collection—Part 1: Automatic Memory Management in the Microsoft .NET Framework - Jeffery Richter
http://msdn.microsoft.com/msdnmag/issues/1100/GCI/default.aspx
Garbage Collection—Part 2: Automatic Memory Management in the Microsoft .NET Framework - Jeffery Richter
http://msdn.microsoft.com/msdnmag/issues/1200/GCI2/default.aspx
Garbage Collector Basics and Performance Hints - Rico Mariani
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/dotnetGCbasics.asp
this link is broken as of now – I will update the post if I get the new location – but I will strongly recommend you to follow Rico's blog for GC and performance details.
Cleaning Up Unmanaged Resources
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcleaningupunmanagedresources.asp
Programming for Garbage Collection
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconprogrammingessentialsforgarbagecollection.asp
Garbage collection and resource deallocation
http://www.thecodeproject.com/csharp/gcresdealloc.asp
Roadmap for garbage collection in the Microsoft .NET Framework
http://support.microsoft.com/default.aspx?scid=kb;en-us;317866
OverView of GC:
http://msdn.microsoft.com/msdnmag/issues/1100/GCI/default.aspx
.NET GC Myth #2 -- The GC Frees Memory
http://weblogs.asp.net/pwilson/archive/2004/02/20/77429.aspx
Using GC Efficiently – Part 2
http://blogs.msdn.com/maoni/archive/2004/09/25/234273.aspx
OutOfMemoryException and Pinning
https://blogs.msdn.com/yunjin/archive/2004/01/27/63642.aspx
Managed Code/IL/Assembly
- http://blogs.msdn.com/trobbins/articles/404939.aspx
Inside Microsoft .NET IL Assembler by Serge Lidin
Feature difference between 2.0 and 3.0
The best site I know that can serve as a starting point to understand new features and developments in .NET 3.0 and .NET 3.5 is
http://www.netfx3.com/
Understanding differences of the Native and Managed worlds
Migrating Native Code to the .NET CLR
http://msdn.microsoft.com/msdnmag/issues/01/05/com/