blog.easyciel.net author="Patrick Rabian" about="c#, sharepoint, biztalk, team system resources" more="news, samples, tips for .NET world's developers !"

Building .NET 1.1 application with Visual Studio 2005

Wednesday, 10 January 2007 17:33 by prabian

1- Start with downloading this archive :

CompileWithDotNet11.zip

2- Check the requirements :

Visual Studio 2005, C#
Framework .NET 1.1
CompileWithDotNet11.zip (cf 1!)

3- Follow the instructions :

- Copy ‘DotNet11Compile.CSharp.targets’ to C:\Program Files\MSBuild (This file was initialy built by Jomo, I have just changed 2 lines : http://blogs.msdn.com/jomo_fisher/articles/410896.aspx)
- Open Visual Studio 2005 and create an empty C# project (console, library, winform, …) or open a old Visual Studio 2003 C# project and accept the convertion
- Save it and close Visual Studio 2005
- Open the .csproj file with notepad
- Change the following line
 
 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />

 by

 <Import Project="$(MSBuildExtensionsPath)\DotNet11Compile.CSharp.targets" />

- Re-Open the C# project
- Open the Configuration manager (Right-Click the solution and select it in the menu or open the ‘Debug/Release’ drop-down list en select it)
- Choose ‘New’ in the ‘Active Solution Plateform’ list (Current selected value should be ‘Any CPU’)
- Select ‘.NET 1.1′ and validate
- Build
(If necessary, correct errors on lines like ’using System.Collections.Generic;’ by commenting it and rebuild)

The archive ‘CompileWithDotNet11.zip’ contains a sample C# console project.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Understanding WCF advanced concepts and comparing it to ASMX 2.0 or WSE 3.0

Wednesday, 10 January 2007 09:21 by prabian

Essentials references for understanding WCF….

WCF Base

WCF Callbacks, Events

WCF Instances Management

WCF Features comparison : (table below was extracted from this article)

Web Service Software Factory

Feature
ASMX 2 .0 plus WSE 3. 0
WCF
Hosting
IIS/ASP.NET (.asmx)
SoapReceivers
IIS/ASP.NET (.svc)
ServiceHost<T>
WAS
Programming Model
[WebService], [WebMethod], and so on (supports interfaces, generics, and the like)
[ServiceContract], [OperationContract], and so on (supports interfaces, generics, and so on)
Message Exchange Patterns (MEP)
One-way
Request-response
Custom (using WSE API)
One-way
Request-response
First/last-operation
Duplex
Custom

XML Serialization

 
 
System.Xml
.Serialization
System.Runtime
.Serialization
System.Xml.Serialization
(you can choose)

Encodings

 
XML 1.0
MTOM
DIME
Custom
XML 1.0
MTOM
Binary
Custom

Transports

 

 

 
HTTP
TCP
Custom
HTTP
TCP
Named pipes
MSMQ
P2P
Custom

Protocols

 

 

 
Security
Security
Reliable messaging
Transactions
Behaviors (enabled via attributes or configuration
Local DTC transactions
HTTP buffering
HTTP caching
HTTP sessions
Custom (via SoapExtensions, WSE filters)
Concurrency
Instancing
Throttling
Thread-binding
Exception handling and faults
Impersonation
Session management
Transaction behaviors
Custom (via behavior types)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:   ,
Categories:   Architecture | Web Services | XML
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Exception “Thread was being aborted” while doing Response.End, Response.Redirect or Server.Transfer

Friday, 5 January 2007 09:23 by prabian

To avoid this error, replace :

Response.End
 with HttpContext.Current.ApplicationInstance.CompleteRequest();

Response.Redirect(url) with Response.Redirect(url, false)

Server.Transfert with Server.Execute

For details, consult the microsoft kb : http://support.microsoft.com/kb/312629/EN-US/

Currently rated 4.0 by 2 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:   ,
Categories:   Asp.net | Asp.net
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

How to read an event log

Tuesday, 2 January 2007 17:57 by prabian

Sample console application that read the content of an event log…

——–

using System;
using 
System.Collections.Generic;
using 
System.Text;
using 
System.Diagnostics;

namespace EventLogReader{
  
public class 
Program {
    
static void Main (string
[] args){
      EventLog logger=
new EventLog("Application"
);
      
int maxLineLength=30
;
      
string logFilter="*";     
//*, I, W, E, ?            
      
string 
message;
      
string 
type;
      
int counter=0
;
      DateTime start, end;
      TimeSpan executionTime;
      start=DateTime.Now;
      
foreach (EventLogEntry entry in 
logger.Entries){
        message=entry.Message.Replace(
"\n"" "
);
        
if (message.Length>maxLineLength) message=message.Substring(0, maxLineLength)+"…"
;
        
switch 
(entry.EntryType){
          
case EventLogEntryType.Information: type="I"
;
          
break
;
          
case EventLogEntryType.Warning: type="W"
;
          
break
;
          
case EventLogEntryType.Error: type="E"
;
          
break
;
          
default: type="?"
;
          
break
;
        }
        
if (logFilter=="*" 
|| logFilter==type) {
          Console.WriteLine(
"[{4}>{0}-{1}({2})] {3}", type, entry.Source, entry.InstanceId, message, entry.TimeWritten.ToString("dd/MM/yyyy HH:mm:ss"
));
          Console.Out.Flush();
          counter++;
        }
      }
      end=DateTime.Now;
      executionTime=end-start;
      Console.WriteLine(
"{0} row(s) displayed in {1} ms. Press a key to quit…"
, counter, executionTime.TotalMilliseconds);
      Console.Read();
    }

  }

}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:   ,
Categories:   C# sample code
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed