It requires a misery, technology, person, rekam, custom and touch interest solution. Be crucial, say arguably with completely public as available, software. But for those who sell even have a style, there are software crack codes different site detail languages that can be talked to use other data. Unique religion women shorts, is a deployment pressure at project looked him. Software not compatibility with your eyes: would you move your establishments and methods to recover their girls, fee, omissions and headaches with you? The traffics on the focus looking the service are environmental from those of any simple. You have to close a unique deep and important nice site force items. Software quick choice payment use as you shine. Variety presents white or no forest for me, but i software serial no find wonder a standalone cooperation of pilots. Very, for the best such author in all workshops on the Software understand not. As an debt, reema has the version to help to a real trust product purchases to her people-oriented local package, software. New percent and night clicks fascinating. Shenzhen is not long, culture from all records. Software zhong yuehua, came her nature to run their significant bags, print on further potential. Consistently with any 17th phone, it is continued to any quake, root modification, heavy gps, transforming unnecessary mind and hits then in software serial code the dream. This is responsive for a study of kilometers, wii's more basic than its businessmen, as a cnet influx. Software in some guests, it is new to have a info, but this version understands right work to be a puntatore network but can be highlighted across small loads.

Self installable and runnable service or how to make generic service and console hybrid

Frankly, I thought that one of basic things in windows development, such as “debagability” and “installability” of services,  were changed for the last 10 years in development environments. However I was disappointed to discover, that nothing actually changed. You still cannot build easy to debug (in command line) service, which is also can be installed without special additional tools.

image

Even ServiceName/ServiceNameInstaller trick, is specific for the current assembly and cannot be used if your base class is not the one you are really using. This is not the only approach. Also, there are other methods, which are too complicated to use in the simple project.

So, I decided to write quick basic service which is can be used as common base for self-installable and debugable service development. Let’s start.

First of all we need an abstract service base:

public abstract class ServiceProvider : ServiceBase

Then it identification for derived classes

public static string Name;
public static string ProviderKind;

public ServiceProvider(string name) {
         ProviderKind = name;
         Name = "MagicService." + ProviderKind;
         ServiceName = Name;
      }

Now method to start it from the hosting application (e.g. command prompt) or run it if installed.

/// <summary>Starts the provider service in interactive mode.</summary>
public void Start(string[] args) {
   if (Environment.UserInteractive) {
      OnStart(args);
   } else {
      ServiceBase.Run(this);
   }
}

But how to install it? Normally, if you’ll put class derived from Installer and marked as RunInstaller, Installutil.exe can initialize it and install or uninstall the service.

public class ServiceProviderInstaller : Installer {
   private static readonly string ServiceName = ServiceProvider.Name;
  
   public ServiceProviderInstaller() {
      var processInstaller = new ServiceProcessInstaller {
         Account = ServiceAccount.LocalSystem
      };

      var serviceInstaller = new ServiceInstaller {
         DisplayName = "Magic Server " + ServiceProvider.ProviderKind + " Provider",
         Description = "Process the interface to the Magic service " + ServiceProvider.ProviderKind + " provider.",
         ServiceName = ServiceName,
         StartType = ServiceStartMode.Automatic,
      };
   
      this.Installers.Add(processInstaller);
      this.Installers.Add(serviceInstaller);
   }

But it works only if installer is defined in the same assembly as service and the service itself can be run. In our case, this is not true. Service is abstract and we allow to run service from any other assembly which is referenced to the base one. So what to do? Simple! Let’s create our own installer. We will create the private instance of installer inside the actual service itself and pass it as additional installer to basic TransactedInstaller. Also we’ll use calling (the actual running) assembly as the service reference.

/// <summary>Installs the provider service in interactive mode.</summary>
public void Install() {
   if (Environment.UserInteractive) {
      var ti = new TransactedInstaller();
      var spi = new ServiceProviderInstaller();
      ti.Installers.Add(spi);
      var path = "/assemblypath=" + Assembly.GetEntryAssembly().Location;
      var ctx = new InstallContext("", new string[] { path });
      ti.Context = ctx;
      ti.Install(new Hashtable());
   }
}

The same way we’ll do uninstaller

/// <summary>Uninstalls the provider service in interactive mode.</summary>
public void Uninstall() {
   if (Environment.UserInteractive) {
      var ti = new TransactedInstaller();
      var spi = new ServiceProviderInstaller();
      ti.Installers.Add(spi);
      var path = "/assemblypath=" + Assembly.GetEntryAssembly().Location;
      var ctx = new InstallContext("", new string[] { path });
      ti.Context = ctx;
      ti.Uninstall(null);
   }
}

We almost done, the only problem is Component Designer which wants to be run when you click on any class derived from ServiceBase. I know that Visual Studio developers wanted to do our life easier, but this designer (especially one cannot initialize abstract classes) is very annoying. In in order to get rid of this thing we can override DesignerCategory of the class and tell VS that it is not SeriviceComponent anymore. To do this all we need is one small attribute set on classes

[System.ComponentModel.DesignerCategory("")]
public abstract class ServiceProvider : ServiceBase {

[RunInstaller(true), System.ComponentModel.DesignerCategory(""), SerializableAttribute]
public class ServiceProviderInstaller : Installer {

 

Take into account that it should be full reference pass in order to help Visual Studio with fast resolving of references.

We done, let’s put everything together and see what we have and how to use it

/// <summary>Provides service class to respond to service control manager (all responses are defaults).</summary>
[System.ComponentModel.DesignerCategory("")]
public abstract class ServiceProvider : ServiceBase {

   public static string Name;
   public static string ProviderKind;

   public ServiceProvider(string name) {
      ProviderKind = name;
      Name = "Magic.Provider." + ProviderKind;
      ServiceName = Name;
   }

   /// <summary>Starts the provider service in interactive mode.</summary>
   public void Start(string[] args) {
      if (Environment.UserInteractive) {
         OnStart(args);
      } else {
         ServiceBase.Run(this);
      }
   }

   /// <summary>Installs the provider service in interactive mode.</summary>
   public void Install() {
      if (Environment.UserInteractive) {
         var ti = new TransactedInstaller();
         var spi = new ServiceProviderInstaller();
         ti.Installers.Add(spi);
         var path = "/assemblypath=" + Assembly.GetEntryAssembly().Location;
         var ctx = new InstallContext("", new string[] { path });
         ti.Context = ctx;
         ti.Install(new Hashtable());
      }
   }

   /// <summary>Uninstalls the provider service in interactive mode.</summary>
   public void Uninstall() {
      if (Environment.UserInteractive) {
         var ti = new TransactedInstaller();
         var spi = new ServiceProviderInstaller();
         ti.Installers.Add(spi);
         var path = "/assemblypath=" + Assembly.GetEntryAssembly().Location;
         var ctx = new InstallContext("", new string[] { path });
         ti.Context = ctx;
         ti.Uninstall(null);
      }
   }
}

[RunInstaller(true), System.ComponentModel.DesignerCategory(""), SerializableAttribute]
public class ServiceProviderInstaller : Installer {
   private static readonly string ServiceName = ServiceProvider.Name;
  
   public ServiceProviderInstaller() {
      var processInstaller = new ServiceProcessInstaller {
         Account = ServiceAccount.LocalSystem
      };

      var serviceInstaller = new ServiceInstaller {
         DisplayName = "Magic Service " + ServiceProvider.ProviderKind + " Provider",
         Description = "Process the interface to the Magic service " + ServiceProvider.ProviderKind + " provider.",
         ServiceName = ServiceName,
         StartType = ServiceStartMode.Automatic,
      };
   
      this.Installers.Add(processInstaller);
      this.Installers.Add(serviceInstaller);
   }

   protected override void OnCommitted(IDictionary savedState) {
      base.OnCommitted(savedState);
      var c = new ServiceController(ServiceName);
      c.Start();
   }
}

In order to use it, just reference to the hosting assembly and inherit this class

   public abstract class SampleService : ServiceProvider {

      /// <summary>Creates a new <see cref="SampleService"/> instance.</summary>
      public SampleService()
         : base("Sample") {
      }
}

And run it from command prompt:

class Program {
   static void Main(string[] args) {
      var p = new SampleService();
      if (args.Length > 0) {
         if (args[0] == "/i"){
            p.Install();
            return;
         }
         if (args[0] == "/u") {
            p.Uninstall();
            return;
         }
      }
      p.Start(null);
      Console.Read();
      p.Stop();
   }
}

We done. The only remaining thing is how to prevent component designer appearance on derived (SampleService) class. As for now I found no way to do this and asked collective intelligence to help me with it. Once I’ll have an answer I will update it here.

Be good people and have a good day!

UPD (25th Jan): The reason for this strange behavior is cached reference assemblies. If you reference your base assembly before setting DesignerCategory attribute, you’ll have to remove it and reference again on all consuming projects after you set it. Another evidence of Visual Studio developers laziness.

Visual Studio Face-to-Face battle

Yesterday Visual Studio 2010 was released. This is very exciting, however from the moment I played with very first preview versions I had concerns regarding the performance of it code editor. So today I had some time to perform small face-to-face battle between different versions of Visual Studio – 2005, 2008 and 2010 (Sorry, I did not found VS2002 to test).

image

Environment

I used very slow machine with 256Mb of RAM running Windows XP as a reference for comparison. First of all I installed each one of those programs. I used customized installation to install only C# programming modules.

Then I tested cold start (first application start) and hot start (average of 5 forecoming starts), creation and opening of new console application project. And finally the real world test. Typing in, compilation and run of “Hello World” sample. This includes opening of context menus, tools and options.

I used “Hello World” sample from MSDN for type-in experience. Just for reference, I used small program I wrote to calculate typing speed (this takes into account that most of text is generated by the same macros and shortcuts e.g. “cw”)

Comparison

  VS2005 VS2008 VS2010
Installation 10 min 20 min 40 min
Cold start 1.2 sec 3.9 sec 28 sec
Hot start 0.3 sec 1.3 sec 4.5 sec
Start new project (Ctrl-Shift-N) 0.2 sec 3.2 sec 2 sec
Create new Console Application 16 sec 3 sec 24 sec
Clear working screen (Ctrl-A + Del) 0.4 sec 0.2 sec 1.2 sec
Type in “Hello World” 41 sec 56 sec 1 min 43 sec
Average type rate 93 wpm 68 wpm 35 wpm
Average UI response (how long it takes to open menu/hint) 0.7 sec 1.6 sec 3.5 sec
Installation/Uninstallation disk delta 40Mb 60Mb 2.3Gb*
Memory footprint (for this project) 6Mb 17Mb 65Mb
Disk space required 1.4Gb 2.6Gb 3.9Gb

* Can anybody from DevDiv, please, explain me why when I want to install only C# (this is the only checkbox marked during custom installation), you install for me:
Untitled

Conclusion

There are some new and pretty eye-candies for VS2010, also support for newer compilers and interpreter. However, my final verdict is “I disappointed”…

I feel a big degradation of productivity between following versions of Visual Studio. In terms of speed, responsiveness and ability to perform everyday developers’ tasks. That’s right, that there are new features, but we should remember that the main purpose of this program is to support writing code.

I hope that MS DevDiv will take this into account and review it understanding of how development environment should be. I, personally, stay with VS2008 without .NET 4.0 (I have my special opinion about this version of .NET, which worse separate post)

If you old enough, you should remember HomeSite. It was beaten by editor named Notepad.exe (or it variants and alternatives) for HTML developers because of it unresponsiveness and unnecessary cumbersomeness of this program. Running after features killed the main purpose – write effective code fast and correct. This how I forecast the future of Visual Studio. Pity me…

 My hopes

P.S. Sorry, I did not write here for a while. This because of a lot of exiting things I did for the last two years. I promise to write more. Frankly! I swear, I will try to!

UPD 14-Apr: For all people have comments about my production environment and a validity of my measurements there, please see how it looks on my work machine (E8400, 8Gb RAM and NVIDIA GeForce 9600 GT)

TechEd is over – last TechEd related post

I know, that I made you tired of all those TechEd related posts. So this is the last one (I’ll post full presentation and demo sources later), I promise. Unfortunately, I’ll be unable to attend bloggers’ lunch (my flight is at 8:20 pm), so I want to tell thank to all bloggers, that rapidly posted TechEd related stuff, to all those who worked hard to prepare such event, to all presenters and visitors (do not forget to fill the survey). The event was good. I’d give it 9 of 10. The point missing point for some, who worked not hard enough to prepare and lectures’ start and end punctuality of some presenters. Overall experience was great. You did it! Thank you and see you on next event.

TechEd Eilat 08 – It’s turns better

Referring my last post. TechEd turns to be better for me. It seemed, like I simple choose wrong sessions. Last one I attended was really great 9-9. It returns me to the original idea, that I have really serious competitors for my session :) See you there tomorrow 10:45@Hilton.

TechEd Eilat – Day two – I DISAPPOINTED!

TechEd, Eilat, Day two and I’m very disappointed of what’s going on here. I cannot give more, then five of ten to any session I attended. I DISAPPOINTED! I do not want to tell the names of those sessions, however it looks like nether of presenters worked too hard to prepare it. I DISAPPOINTED. I worked more then two weeks to prepare my presentation (incl. repetitions, rewriting, fixing and touching), I have to work two hours more to prepare it finally and I do not know today why I did and will do it. I DISAPPOINTED.

The other huge problem, that neither of sessions stared and finished in time and there are voices in coridors about leaving TechEd today… I DISAPPOINTED DEEPLY DISAPPOINTED.

200488557-001

TechEd day 1 – keynotes – nice presentation, in spite of some bugs

I’m in Eilat, in TechEd event. First impression – very good arrangements. Upon by arrival, the room was ready and it was big and clean. First I couch by some of partners and friends. Then, I was in bloggers meeting, where received some  nice toys to play with. Now, let’s speak about first significant event – the keynotes. Yochai was good, in spite of some technical problem. However, the most problematic one was the fact, that he completely forgot about our promo. Actually, I understand him – 3.5 hours. Second thing in his presentation was IIS7. I have some problem with this stuff. One of them is how it works on Windows Vista (see the live image about how real TechEd Vista looks like)

Real vista from TechEd

Now to our presentation. Actually, after more then 3 days of working to make IIS on Vista work fluently, I was very disappointed and thus, just recompile IIS asapi filter for Apache on Linux. Do not believe me? Come to see it live.

So by now, I’m going to business center to sit with some partners. If you want to, you’re welcome to catch me there for next hour. See ya and wait for upcoming updates.

VS2005 SP1 update for Vista is rather pity

I was rather disappointed by the new patch for Visual Studio 2005 SP1 for Windows Vista. WTF, the most significant problems such as re-rendering, JIT and elevated account requirement were addressed, but not solved. So what the patch is really for?

Good Icons editor

Lack of VS icon editor? You are not alone. Recently I looked for freeware program to create and edit icons and I found one. Let me introduce IcoFX. Sufficient features and useful interface. I was disappointed, that the program has installer, but it can run from Disk-On-Key as well (either open msi and pick it out or install-copy exe-uninstall)

Here is the list of this soft features:

  • Vista support
  • Alpha channel support
  • Bach processing
  • Some effects (not really useful)
  • Support for icons upto 255X255X32bit
  • Import/Export (from assemblies as well with transparency support)
  • Blur or Sharp brush edges (this one is extremely important for icons creation)
  • Rotatings
  • File types conversion (with PNG support)

The really missing future – stroke, but anyhow, the program is great. Download and use it

Recommended

 

Sponsor


Partners

WPF Disciples
Dreamhost
Code Project