background preloader

.NET

Facebook Twitter

Deployment of a Website on IIS. Deployment of a Website on IIS During last few days, I was deploying my application and I faced a lot of issues. I found deploying an application properly is as much as important as developing application. If application is not deployed properly, it can be very harmful to you application Here I want to share my learning to you all. For deployment, first we need to understand IIS, it's request processing and then we'll go for deployment of the website and various configuration available in IIS, their key features, advantages and disadvantages etc.. IIS at root level, a Windows Service that is responsible for processing requests received on specific ports. The complete configuration (with all its settings) is stored in a file, called a metabase, on local system.

IIS and URL Processing: Normally ,Web application are accessed and processed through browser. First, IIS examine the requested URL. IIS 6.0 Process Model: Managing a Virtual Directory : Making a Virtual directory: 2. 3. 4. 5. 4. 5. Beginner's Guide: Exploring IIS 6.0 With ASP.NET. Table of Contents Introduction In the past, I have written a few articles for beginners and had got a very good response from all readers. This time I have planned to write an article on IIS 6.0 and Integration of IIS with ASP.NET. I have worked on IIS 5.1, IIS 6.0, and IIS 7.0. Though the purpose of all IIS servers are the same, they are very different in their architecture and use. Don't worry, I am not going to explain the differences of those three versions of IIS. What is a Web Server Visual Studio has its own ASP.NET engine which is responsible for running your web application so you don't have any problems running an ASP.NET application from the VS IDE.

IIS Server Overview The first client will make a request to the web server (IIS), the web server checks the request and will pass the request to the ASP.NET Process (don't get confused here, I have explained the details), the ASP.NET process engine will process the request and pass the response to the client via the web server. Asp.net - Default.aspx with IIS 6.0 and .Net 4. Tuple Class (System) Tuples are commonly used in four ways: To represent a single set of data. For example, a tuple can represent a database record, and its components can represent individual fields of the record.To provide easy access to, and manipulation of, a data set. To return multiple values from a method without using out parameters (in C#) or ByRef parameters (in Visual Basic).To pass multiple values to a method through a single parameter.

For example, the Thread.Start(Object) method has a single parameter that lets you supply one value to the method that the thread executes at startup time. If you supply a Tuple<T1, T2, T3> object as the method argument, you can supply the thread’s startup routine with three items of data. The Tuple class does not itself represent a tuple. Instead, it is a factory class that provides static methods for creating instances of the tuple types that are supported by the .NET Framework.

Wintellect's Power Collections for .NET. Object Oriented Programming In VB.NET. Download source files - 10.7 Kb Contents Introduction VB.NET is completely object oriented. This article uncovers some basic Object Oriented Programming features of Visual Basic. NET. The whole article is divided into ten lessons. This tutorial is designed with the following objectives: To provide a sound knowledge about Object Oriented Programming in VB.NET.

Go through this tutorial and you will start making sense of almost any .NET code. Using the code The source code for each lesson is available as a .vb source code file. To manually compile a source code file, you may use the command prompt to type: vbc filename.vb /out:"filename.exe" /r:"System.Windows.Forms.dll","System.dll" Lesson 1: Namespaces, Classes & Objects, Modules A NamespaceIn VB.NET, classes and other data structures for a specific purpose are grouped together to form a namespace. Lesson 2: Access Types The major access types are Public, Private, Friend and Protected. Import the System namespace (already available in .NET). Reflection in .NET. Download code samples - 27.7 KB Contents Introduction In this article, I have tried to cover all the topics from .NET Reflection with examples.

I have stated with the definition of .NET Reflection and its road map, a list of mostly used classes the System.Reflection namespace provides, and the importance of the Type class in .NET Reflection. You will also learn how to get the type information using different ways. Use of properties and methods of the Type class in .NET Reflection, with examples, are explained in this article. You will also see advanced Reflection topics like dynamically loading an assembly and late binding, at the end of this article.

What is .NET Reflection? .NET Framework's Reflection API allows you to fetch type (assembly) information at runtime programmatically. Using Reflection, you can get any kind of information which you can see in a class viewer; for example, information on the methods, properties, fields, and events of an object. Road Map The System.Type Class Output. A Beginner’s Guide to calling a .NET Library from Excel « Rich Newman. Introduction It’s actually very easy to call a .NET library directly from Excel, particularly if you are using Visual Studio 2005. You don’t need Visual Studio Tools for Office. However there doesn’t seem to be an easy guide on the internet anywhere.

MSDN help is quite good on the subject, but can be a little confusing. This article is an attempt to redress the situation. This article was updated 24th August 2007 to cover Excel 2007 and to clarify the issues with intellisense. A Basic Walk Through We’ll start by walking through a very basic example. 1. 2. Using System; using System.Collections.Generic; using System.Text; namespace DotNetLibrary { public class DotNetClass { public string DotNetMethod(string input) { return "Hello " + input; } } } That’s it: if you look at existing articles on the web, or read the MSDN help, you might think you need to use interfaces, or to decorate your class with attributes and GUIDs. 3. 4. 5. 6. 7. 8.

Getting Intellisense Working in Excel 1. 2. 3. 4. 5. 6. How to consume .NET dll from Classic ASP application? - Code Issue. You can definitely use your .NET assembly in ASP or VB6 application. What you need to do is add [ComCompatible] attribute in your AssemblyInfo.cs file and register your dll using RegAsm.exe. In AssemblyInfo.cs, add: [assembly: ComVisible(true)] Then use RegAsm.exe tool which is part of .NET SDK to register the .NET dll to be used as COM component: Regasm ClassLibrary1.dll /tbl This command above will generate Type Library file and register .NET dll in the registry. Now, you can reference your dll in VB6 or ASP like:Early binding example: Dim test As ClassLibrary1.Class1 'This is .NET class registered using RegAsm.exeSet test = New ClassLibrary1.Class1MsgBox (test.MyMethod()) Late binding example: Dim test As ObjectSet test = CreateObject("ClassLibrary1.Class1") 'This is .NET class registered using RegAsm.exeMsgBox (test.MyMethod()) More detail on type library: More detail on early binding vs late binding:

Calling COM Components from .NET Clients. Mike Gunderloy Lark Group, Inc. November 2001 Summary: In this document, you'll learn the details of calling COM servers from .NET clients. (14 printed pages) Objectives Understand the concept of Runtime-Callable Wrappers Use TLBIMP to create an Assembly from a COM component Reference a COM component directly from Microsoft® Visual Basic® .NET code Assumptions The following should be true for you to get the most out of this document: You are familiar with Visual Basic programming You are familiar with COM concepts.

Contents The Joy of Interoperability Practice Calling COM from .NET Using the COM Component Directly Summary The Joy of Interoperability Sometimes a revolution in programming forces you to abandon all that's come before. But what if you decide on the radical move of switching development to another operating system entirely? Fortunately, switching from COM to Microsoft .NET involves no such radical loss of productivity. .NET components can call COM components.

Figure 1. Table 1. Odds and Ends: Making a .NET Dll COM-Visible. In this post, I want to explain how I created a dll in C#/.NET using Microsoft Visual Studio 2008 that could be accessed from an Excel VBA program. In order for VBA to access it, a dll has to be COM-visible. See Wikipedia; Component Object Model for more details. However, Microsoft's description at Exposing .NET Framework Components to COM is quite hard to understand. I hope this step-by-step explanation of an actual example will be easier to follow. Summary I created a dll, called MdJLibrary.dll, that defines a function WidthInPoints in the class TextFunctions. Step 1. A. In Microsoft Visual 2008, select File, then New and Project. B. Here is the initial code. C. This avoids versioning problems, and increases security. Open the project properties (select Project then ), and select the Signing tab. Step 2. Create a separate, small .NET program to test the dll.

I haven’t included the test program listing here. Step 3. There are several stages to this. A. Using System.Runtime.InteropServices; Mon Knowledge: The Mystery of mscorlib. I had an interesting problem recently while converting a Visual Studio 2008 project to Visual Studio 2010. This was a solution that included a website project and a number of library projects (side note: I don't recommend website projects, try web application projects instead). The website project and all of the library projects targeted the .NET 3.5 framework. The Reason I was converting this project was just to use the new features of VS 2010; I didn't want to go through a full conversion of the project to .NET 4.0 because that would have meant testing and deployment time I didn't have.

So when the framework warning dialog appeared: I clicked, "No. " So far so good. But now I had a problem. This got me thinking: I knew that mscorlib is the assembly that contains the core implementation of the .NET framework, so why don't we see it in the Visual Studio reference list? Now we're getting somewhere! Back to our problem: how do we eliminate this phantom 4.0 reference?