Categories
How-to Microsoft Tools

Merge multiple .NET assemblies into a single Assembly using ILMerge Utility

ILMerge is a utility that can be used to merge multiple .NET assemblies into a single assembly. ILMerge takes a set of input assemblies and merges them into one target assembly.

The first assembly in the list of input assemblies is the primary assembly. When the primary assembly is an executable, then the target assembly is created as an executable with the same entry point as the primary assembly. Also, if the primary assembly has a strong name, and a .snk file is provided, then the target assembly is re-signed with the specified key so that it also has a strong name.

If you aren’t aware about Assemblies, do read this introduction article here

ILMerge is packaged as a console application. But all of its functionality is also available programmatically. There are several options that control the behavior of ILMerge. ILMerge runs in the v2.0 .NET Runtime, but it is also able to merge v1 or v1.1 assemblies. However it can merge PDB files only for v2 assemblies. 

Download the ILMerge tool here [.msi format]

Currently, ILMerge works only on Windows-based platforms. It does not yet support Rotor or Mono. You can find more information about this tool here the ILMerge web site.

To read more on the Side-by-Side Assemblies and WinSxS folder, I would recommend you check this article which was written sometime ago!

Also read,

Categories
Best Practices Microsoft Windows Installer, Application Compatibility and Deployments

What version of the .NET Framework is included in which version of the OS?

Its been quite sometime that, we have recieved questions on what version of the .NET Framework is included in which version of the OS? The main reason for this question is that, when the .NET Framework is installed as a part of the OS, it does not appear in the Programs and Features (or Add/Remove Programs) control panel. Peter Marcu has documented this in a nice pictoric representation. This is gonna be helpful to many!

What version of the .NET Framework is included in what version of the OS?

Update : 6th August 2010 – Microsoft has posted an updated knowledge base article today with a unified list of install state and service pack level detection information for each of the currently released versions of the .NET Framework (1.0, 1.1, 2.0, 3.0, 3.5 and 4).  You can find the knowledge base article at http://support.microsoft.com/kb/318785

Aaron Stebner had also answered this in one of his mailbag questions, here is the answer which he gave!

The following is a complete list of which version of the .NET Framework is included in which version of the OS:

  • Windows XP Media Center Edition (Windows XP SP1) includes the .NET Framework 1.0 + SP2 as an OS component
  • Windows XP Media Center Edition (Windows XP SP2 and higher) includes the .NET Framework 1.0 + SP3 as an OS component.  On Windows XP Media Center Edition, the only way to get the .NET Framework 1.0 SP3 is to install Windows XP SP2 or higher.  There is not a standalone 1.0 SP3 installer for this edition of Windows XP.
  • Windows XP Tablet PC Edition (Windows XP SP1) includes the .NET Framework 1.0 + SP2 as an OS component
  • Windows XP Tablet PC Edition (Windows XP SP2 and higher) includes the .NET Framework 1.0 + SP3 as an OS component.  On Windows XP Tablet PC Edition, the only way to get the .NET Framework 1.0 SP3 is to install Windows XP SP2 or higher.  There is not a standalone 1.0 SP3 installer for this edition of Windows XP.
  • Windows Server 2003 (all x86 editions) includes the .NET Framework 1.1 as an OS component; 64-bit versions of Windows Server 2003 do not include a version of the .NET Framework as an OS component
  • Windows Vista (all editions) includes the .NET Framework 2.0 and 3.0 as OS components  3.0 can be added or removed via the Programs and Fatures control panel.
  • Windows Vista SP1 (all editions) includes the .NET Framework 2.0 SP1 and 3.0 SP1 as OS components.  3.0 SP1 can be added or removed via the Programs and Features control panel.
  • Windows Server 2008 and Windows Server 2008 SP1 (all editions) includes the .NET Framework 2.0 SP1 and 3.0 SP1 as OS components.  The .NET Framework 3.0 SP1 is not installed by default and must be added via the Programs and Features control panel though.
  • Windows Server 2008 SP2 (all editions) includes the .NET Framework 2.0 SP2 and 3.0 SP2 as OS components.  The .NET Framework 3.0 SP2 is not installed by default and must be added via the Programs and Features control panel though.
  • Windows Server 2008 R2 (all editions) includes the .NET Framework 3.5.1 as an OS component.  This means you will get the .NET Framework 2.0 SP2, 3.0 SP2 and 3.5 SP1 plus a few post 3.5 SP1 bug fixes.  3.0 SP2 and 3.5 SP1 can be added or removed via the Programs and Features control panel.
  • Windows 7 (all editions) includes the .NET Framework 3.5.1 as an OS component.  This means you will get the .NET Framework 2.0 SP2, 3.0 SP2 and 3.5 SP1 plus a few post 3.5 SP1 bug fixes.  3.0 SP2 and 3.5 SP1 can be added or removed via the Programs and Features control panel

In addition, the .NET Framework shipped with the following versions of Windows but not as truly integrated OS components:

  • Windows XP Home and Professional SP1 includes the MSI-based .NET Framework 1.0 + SP2 in the Additional Components folder on the installation CD.  It is not an OS component on this OS.
  • Windows XP Home and Professional SP2 includes the MSI-based .NET Framework 1.1 + SP1 in the Additional Components folder on the installation CD.  It is not an OS component on this OS.
  • Windows XP Home and Professional SP3 includes the MSI-based .NET Framework 1.1 + SP1 in the Additional Components folder on the installation CD.  It is not an OS component on this OS.
  • Windows Server 2003 R2 includes the MSI-based .NET Framework 2.0.  It appears in Add/Remove Windows Components as an OS component, but selecting it simply invokes the MSI-based installer.  The MSI can be repaired and removed using Add/Remove Programs regardless of whether it is installed via the standalone MSI or via the Add/Remove Windows Components UI.

Courtesy: This is just a information post, the credit for this information goes completely to Aaron Stebner and Peter Marcu. Thank you folks!

Categories
Best Practices General Microsoft

An excellent ebook on Applications for Developers and Solution Architects

Microsoft Application Architecture Guide, 2nd Edition is intended to help developers and solution architects design and build effective, high quality applications.

The guide will helps you to:

  • Understand the underlying architecture and design principles and patterns for developing successful solutions on the Microsoft platform and the .NET Framework.
  • Identify appropriate strategies and design patterns that will help you design your solution’s layers, components, and services.
  • Identify and address the key engineering decision points for your solution.
  • Identify and address the key quality attributes and crosscutting concerns for your solution.
  • Create a candidate baseline architecture for your solution.
  • Choose the right technologies for your solution.
  • Identify patterns & practices solution assets and further guidance that will help you to implement your solution.

Download the Ebook here!!!

Brief Contents

  • What is Software Architecture?
  • Key Principles of Software Architecture
  • Architectural Patterns and Styles
  • A technique for Architecture and Design
  • Layered Application Guidelines – Presentation, Business, Data layer and Service layer Guidelines
  • Component Guidelines – Presentation, Business, Workflow and Data Components
  • Communication and Messaging
  • Physical Tiers and Deployment
  • Choosing an Application Type
  • Designing Web Applications, Rich Client Apps, Rich Internet, Mobile and Service Applications
  • Designing Hosted and Cloud Services
  • Designing Office Business Apps and SharePoint LOB Applications

Download the Ebook here!!!

Categories
General Microsoft

Microsoft makes .NET Micro Framework 4.0 Open Source

Yesterday, at the Microsoft Professional Developer Conference (PDC) at Los Angeles, Microsoft announced not only the release of version 4.0 of  the.NET Micro Framework, but also their stratergies towards open sourcing the product and making it available under the Apache 2.0 license, which is already being used by the community within the embedded space.

mfThe .NET Micro Framework is an innovative development and execution environment for resource-constrained devices.  It brings the same modern computing models that have proven to increase productivity on the desktop to small, intelligent devices. 

In solutions where small devices are integrated with other devices and even the cloud, you can now use the same programming skills and code throughout the solution. Its fully integrated Visual Studio experience brings a reliable and productive development system to the embedded world. 
 
The result of this is that the .NET Micro Framework has become a seamless development experience, bringing a single programming model and tool chain for the breadth of developer solutions, all the way from small intelligent devices, to servers and the cloud. There are also no more time-limited versions. Including the source code for almost all of the product also ensures that developers now also get access to the Base Class Libraries that were implemented for .NET Micro Framework and the CLR code itself.  However, both the TCP/IP stack and Cryptography libraries are not included in the source code.

The TCP/IP stack is third party software that Microsoft licenses from EBSNet, so it does not have the rights to distribute that source code. If someone needs to access the source code for the TCP/IP stack, they can contact EBSNet directly.  As for the Cyptography libraries, they are not included in source code because they are used outside of the scope of the .NET Micro Framework.  Customers who need to have access to the code in the cryptography functions will find that these libraries can be replaced.

Microsoft is also in the process of forming a Community of interested and involved members to help shape the future direction of the product. There will be a core technology team that is composed of Microsoft and external partners, and people will be encouraged to propose projects, which will be vetted before they are accepted. 

You can find more information this framework and download the SDK here

Categories
General Microsoft

Visual Studio 2010 & .NET Framework 4 Training Kit Available for Download

image002This week, Microsoft released the October preview of the Visual Studio 2010 & .NET Framework 4 Training Kit. The content in this training kit has been tested with Beta 2 and is ready for you to use.

Download: Visual Studio 2010 and .NET Framework 4 Training Kit – Here!!!

Training Course on Channel 9

Today, Channel 9 launches an online learning center that will play host to developer focused training courses created by developers for developers.  Channel 9 has always been about giving direct access to the engineers and future technologies from Microsoft.  These videos and labs, with links to extensive training kits, allow developers to get started on hands-on-learning about emerging technologies at your own pace.  
 
image004Explore Visual Studio 2010 Beta 2 with a new training course on Channel 9

The developer evangelists who bring you the 10-4 Show are providing videos and labs for you to get familiar with .NET Framework 4 and Visual Studio 2010. This exclusive opportunity lets developers access free courseware online in a self-paced learning experience.

The online training course allows developers to search for and browse the content without downloading the full training kit.

Browse: Visual Studio 2010 and .NET Framework 4 Training Course – Here!!!

How to Download and Install Visual Studio 2010 Beta 2

image006Visual Studio 2010 Beta 2 is here! In this episode of 10-4, Brian Keller takes us through downloading and installing Visual Studio 2010 Ultimate Beta 2 and Visual Studio 2010 Team Foundation Server Beta 2. This time-compressed video will take you through all of the key things you need to know to get up and running quickly with beta 2.

Watch: Brian’s 10-4 Episode on Channel9 – Here!!!

Categories
General Microsoft

Java to .NET Interoperability – Register for an Exclusive Webcast Series

This 3-part webcast series will explain, how can you use the Java development knowledge to build .NET based applications that interoperate with Java-based Applications.

net_img02

Day 1: .NET Framework – Overview for java Developers

In this session, Bijoy will talk about the architecture of the .Net framework, its components, the similarities and differences between the .Net and J2EE. You can also learn to create your first application in .NET using C# – compile it, run it and dissect it understand the various components and how they interact.

Day 2: Introduction to C# for Java Developers

In this session, you will know how to leverage your knowledge of Java concepts to learn one of the fastest growing modern programming language – C#. While you will understand how you can use your existing knowledge to work with variables, Operators and Expressions, Managing Errors and Exceptions, Object Lifetime, Inheritance etc. we will also show you some of the advanced concepts and power of C# e.g. LINQ, type inference etc.

Day 3: Leveraging your knowledge in real time scenarios

In this session, you will know how you can use your knowledge of both the platforms to enable real scenarios. How you can achieve interoperability in various ways and create feature rich and compelling applications for your clients.

Register for eventHere

 

 

 

Speaker – Bijoy Singhal, Developer Evangelist, Microsoft

 

 

Categories
How-to Windows Installer, Application Compatibility and Deployments

How to manage reboots when installing multiple versions of the .NET Framework

This is one information, which I was looking for since many days.  I just found it on Aaron Stebner’s blog now. Aaron replies to this below question in his blog.

“I am planning a network deployment of the .NET Framework, and I need to deploy all versions from 1.0 through 3.5 SP1 if any are missing on each of the computers on the network.  I have 2 questions related to reboots:

  1. Is it possible to install all versions of the .NET Framework without any reboot being required?
  2. If it is not possible, can I ignore all reboot prompts and only reboot once after installing all versions of the .NET Framework? “

Read the solution and the entire article  here – http://blogs.msdn.com/astebner/archive/2009/09/28/9900528.aspx

Categories
Microsoft Windows Installer, Application Compatibility and Deployments

How does the CLR Locates Assemblies in Applications?

To successfully deploy your .NET Framework application, you must understand how the common language runtime locates and binds to the assemblies that make up your application. By default, the runtime attempts to bind with the exact version of an assembly that the application was built with. This default behavior can be overridden by configuration file settings. The common language runtime performs a number of steps when attempting to locate an assembly and resolve an assembly reference. Each step is explained in the following sections. The term probing is often used when describing how the runtime locates assemblies; it refers to the set of heuristics used to locate the assembly based on its name and culture.

Note You can view binding information in the log file using the Assembly Binding Log Viewer (Fuslogvw.exe), which is included in the .NET Framework SDK.

For Further Reading, Please refer – http://msdn.microsoft.com/en-us/library/yx7xezcf(VS.71).aspx

Categories
How-to Microsoft

How to add WinSxS assemblies into a MSI package?

If you need to install Win32 side by side assemblies globally, you should use the MsiAssembly and MsiAssemblyName tables to do so. Your InstallExecuteSequence table should also include the MsiPublishAssemblies and MsiUnpublishAssemblies standard actions. There is more information on these tables in MSDN and the sample sequence.msi package provided with the Windows Installer SDK (of the Windows SDK) provides a recommended sequence number for those standard actions.

You can refer this article to get the basics of Assemblies

A win32 assembly is an unmanaged assembly (native code). An assembly that is installed to the GAC is actually a managed assembly or otherwise known as a .NET assembly. While the concept of the assembly unit is the same, there are quite a few differences between the two. Typically .NET assemblies are contained within a single module that includes an embedded manifest. For Win32 assemblies, the manifest and catalog file are separate from the binary itself.

You can review the assembly structure yourself by taking a look at the following folders on a Windows Vista machine:

.NET assemblies
%windir%\assembly

Win32 assemblies
%windir%\winsxs

A good starting point on MSDN is http://msdn2.microsoft.com/en-us/library/aa367757.aspx.

Categories
How-to Windows Installer, Application Compatibility and Deployments

Best Practices and Guidelines: Packaging .NET Assemblies

This is a MSDN extract; I have still posted it because many of us do not follow these rules while packaging .NET applications. The Installer can install, remove and update Win32 and .NET assemblies, including side-by-side and private assemblies in Windows XP. To avoid common problems, follow these rules when using assemblies:

General:

  • A component should contain no more than one assembly.
  • All of the files in an assembly should be in a single component.
  • Each component that contains an assembly should have an entry in the MsiAssembly table.
  • The strong assembly cache name of each assembly should be authored into the MsiAssemblyName table.
  • Use the Registry table instead of the Class table when you register COM Interop for an assembly.
  • Assemblies that have the same strong name are the same assembly. When the same assembly is installed by different applications, the components that contain the assembly should use the same value for the ComponentId in their Component tables.

Win32 Assemblies:

  • Do not use the manifest file or the catalogue file as the KeyPath in the Component table for the component containing the Win32 assembly.
  • The KeyPath value in the Component table for a component that contains a Win32 policy assembly should be Null.
  • Add a row to the MsiAssemblyName table for each name and value pair that are listed in the <assemblyIdentity> section of the Win32 assembly’s manifest.

.NET Assemblies:

  • The KeyPath value in the Component table for a component that contains the assembly should not be Null.
    When you install an assembly used by the common language runtime to the global assembly cache, the value in the File_Application column of the MsiAssembly table must be Null.
  • Add a row to the MsiAssemblyName table for each attribute of the assembly’s strong name. All assemblies must have the Name, Version, and Culture attributes that are specified in the MsiAssemblyName table. A publicKeyToken attribute is required for a global assembly.