Tuesday, March 25, 2008

This is quite strange story... but I decided to publish this post because I didn't find any proper solution anywhere; and I mean it ANYWHERE!

It begins like that: I am running an asp.net 2.0 web application that as part of its work, it has to communicate 3rd party assembly, which suppose to retrieve some validation data. Until here everything is just fine right?

In order to invoke the 3rd party service (using an API of course), there is a need to install a X509Cerificate with 'secret' password and to install it on the server that runs the web application. After doing it you must  impersonate the ASP.NET process with the logged-in user that installed the certificate in order to 'grant' this user permission (administrator) to the current context of the web application.

Note: the user credentials will be kept in the web application web.config encrypted of course.

When running this application in my dev box, everything was working just fine, but when done with unit testing and was ready to QA, only when the user that installed the X509Certificate was logged in to the system (windows) the access to this specific certificate could be done. When the user was logged off, the Initialize method that initializes the certificate, couldn't find it in the CurrentUserStore:

public void Initialize(some parameters...)
{
   X509CertificateCollection certificates;
   X509CertificateStore store = X509CertificateStore.CurrentUserStore("My");
   
   store.Open();
   certificates = store.FindCertificateBySubjectName("<subject>");
   if (certificates.Count <= 0)
   {
      throw new Exception("<message>"));
   }
}

I admit that I didn't have any clue of how solving this acute problem, which of course stuck all the process of dev.

After consulting with some colleagues, we decided to try a 'detour solution', that will raise the user up into the system (will keep it alive, unlike doing log off to the user that terminates it from the OS).

Finally the solution (what you've waited for of course): 

We created a blank window service (with an installer) that actually does nothing, complied it and installed it in the QA server. Now here is the catch: First, the window service's startup type is set to Automatically (will be started always when the OS is up). secondly we adjusted the service's log on to a specific account that held the credentials of the user that installed the certificate of course. The purpose of this action is to keep this user up all time in order let our 3rd party application find its certificate in its store.

Outcome - it is working smoothly like magic. We can continue working...

Posted by: Eran Nachum (c)
Post Date: 3/25/2008 8:49:00 PM (Jerusalem Standard Time, UTC+02:00)
Disclaimer | | Trackback   #
 Sunday, March 16, 2008

For those of you that are not working with VS 2008 and still want to create their web application in MVC model, Matias Woloski created the VS 2005 templates just for you ;).

You can download it here and start playing with that.

P.S

Don't forget to install the ASP.NET MVC: http://www.asp.net/downloads/3.5-extensions/

Posted by: Eran Nachum (c)
Post Date: 3/16/2008 9:54:54 PM (Jerusalem Standard Time, UTC+02:00)
Disclaimer | | Trackback   #

Hey, how are you doin'? I know long time no written, this is not because I became a lazy guy or something, that's because I am now in the end development's phase of our (the rest of the members were kept in secret - for now...) private web application called crashcourt.com (temporary name)  - I have to say that the outcome is very impressive - the hard word has worthwhile.

BTW, if you want to be a part of our unique friends & family BETA testers/users, just leave me a comment here, I will be glad to send you an invitation soon...

Regarding the post' subject, if you are using the great AJAX toolkit from Microsoft, it's important you to know that a new version was released by this project members. The major improvements (by the authors) are: ListSearch and AutoComplete.

You can read some more details about it at Delay's blog here.

Posted by: Eran Nachum (c)
Post Date: 3/16/2008 9:19:46 PM (Jerusalem Standard Time, UTC+02:00)
Disclaimer | | Trackback   #

Hi,

Great post that gathers around 100+ resources that could make the web developer life much more easier; code snippets, sites that automate processes, cheat sheets and more and more...

This priceless list is listed here.

BTW, don't become confused from the first image - I also know that this is not a common vision in our world of code... ;)

Posted by: Eran Nachum (c)
Post Date: 3/16/2008 3:35:27 PM (Jerusalem Standard Time, UTC+02:00)
Disclaimer | | Trackback   #
 Wednesday, February 06, 2008

I read a great article about performance and scalability. Some of the issues there were helped me a lot and the rest were sharpen my knowledge.

So, if you are an ASP.NET developer (beginner or senior), It is recommended for you to read that one by Omar Al Zabir at the codeproject site here.

Some if the things that he talks about are: ASP.NET pipeline optimization, Things you must do for ASP.NET before going live, Caching AJAX calls on browse and more...

Worth a reading...

Posted by: Eran Nachum (c)
Post Date: 2/6/2008 5:08:10 PM (Jerusalem Standard Time, UTC+02:00)
Disclaimer | | Trackback   #
 Sunday, February 03, 2008

I want to introduce you (if you not familiar with that) a term called: Startup Weekend. This term is well known and take place every year in US and Europe. Generally, this is an event that gathers around a bunch of 'people' that comes from the hi-tech community: software developers, graphic designers, UI specialists, product managers and more and more....

There is one goal: sit around, think about an idea of a tech project (web site, desktop application whatever...), design it properly - functionality and technologically and finally develop it in order to create a great product at the end of the weekend.

Some more details: this event is being produced by Erez Eden and Dan Rimon and will take place between 3 to 5 in April 2008 at Netwise offices.

So, if you're a software geek (like me ;)) and this idea interest you, you are welcome, I'll going to be there, you can count on it... ;)

More details at: startupweekendisrael.ning.com

See you there...

Posted by: Eran Nachum (c)
Post Date: 2/3/2008 4:56:29 PM (Jerusalem Standard Time, UTC+02:00)
Disclaimer | | Trackback   #
 Wednesday, January 23, 2008

I read a great article regarding of how to optimize the performance of queries (that you or your DBA had written) in SQL Server 2005.

I doesn't matter if your server is 'strong', or if your object oriented code is perfect or even if you're using tools to maintain good performance to the customer, in the bottom line, if you are handling and working with a BIG amount of records in your database, those list of things are worthless if you database SQL queries are being written bad.

The following article outlines some good points and issues regarding this problem and maybe will help you to solve these problems and to maintain good performance.

Posted by: Eran Nachum (c)
Post Date: 1/23/2008 7:18:38 PM (Jerusalem Standard Time, UTC+02:00)
Disclaimer | | Trackback   #
 Thursday, January 10, 2008

Is Google is so kind or what? One more great tool and FREE of course that leashed by Google is the Google Chart API.

By their introduction, The Google Chart API returns a PNG-format image in response to a URL. Several types of image can be generated: line, bar, and pie charts for example. For each image type you can specify attributes such as size, colors, and labels.

If you want to generate charts, graphs, pies etc. this is a great tool for you - the web developer. This tool gives a good fight to all other charts generator like .NET Charting for example and other unwanted ActiveXs modules that need to be installed on the client (we always want to avoid this action - at least me), because it is FREE and also because it is Google.

So I already generated myself:

chart

You can find it here.

Code | HTML | Other
Posted by: Eran Nachum (c)
Post Date: 1/10/2008 7:47:56 PM (Jerusalem Standard Time, UTC+02:00)
Disclaimer | | Trackback   #
 Tuesday, January 08, 2008

While search some interesting and innovating technological stuff on the web, I bumped into 2 articles regarding performance comparison between the classic .NET Remoting (published by Microsoft some years ago) and between WCF technology that ships as part of the .NET Framework 3.0.

The first one has being published by Marcin Celej that claims that: "Sending DataSet with .NET Remoting is faster (in any of cases I tested) than sending it with WCF".

On the other hand, MSDN published also a comparison article, and the evidences were other than the above ones: "When migrating distributed applications written with ... .NET Remoting to WCF, the performance is at least comparable to the other existing Microsoft distributed communication technologies ... WCF is ... approximately 25% faster than .NET Remoting".

Graphs and schemes were published to illustrate the great findings by each one of them.

I am a fan of Microsoft technologies - I admit it, but this issue sounds interesting and worth testing not? What do you think about it?

Posted by: Eran Nachum (c)
Post Date: 1/8/2008 1:57:58 AM (Jerusalem Standard Time, UTC+02:00)
Disclaimer | | Trackback   #
 Sunday, January 06, 2008

First a small introduction to the HTML 5 introduction; If you are wondering why I didn't published during the last 2 weeks, the reason is a great vacation in New York - in one simple word - Insane. (pics will be delivered on the following days).

Now to our topic - HTML 5. We all used to (and still) work and know greatly HTML 4 - which actually is exists something like a decade, but HTML 5 is stands in front of us (but is still to come - the work is still on progress according W3C) and comes to simplify our life (as client developers - side by side to the server hard work of course).

Indeed, HTML 5 will going to introduce a whole new set of elements that will make out lives to much more easier, also based on the fundamentals of HTML 4. The main innovations comes to replace the HTML 4 basic elements as DIV for an instance (which is one of the most used elements) with simplify elements that will use to represent the purpose of each one of them, like header, footer, section etc. - each one of then is a new well known element in the new language. A page rendered with HTML 5 could be shown like the following code snippet:

<body> 
   <header>...</header> 
   
<nav>...</nav> 
   <article> 
      <section> ... </section> 
   </article> 
   <aside>...</aside> 
   <footer>...</footer>
</body>

One of the new innovations is the language definition. It means that HTML 5 is being defined in terms of the Document Object Model (DOM) as a tree representation that will be interpreted by the browser. This definition came from the idea of separating the language itself from its syntax, which can be defined independently.

As we know from previous HTML formats (HTML 4), there are 2 kinds of syntaxes: the HTML itself which is serialized as plain HTML or XHTML which is serialized as XML.

The coin has two sides - each holds its benefits (you also aware of it right? ;)).

The benefits of using HTML 5 (which based on the familiar HTML) are the compatible of existing browsers and the second thing is the acquaintance of it by the authors (in our case - people like me and you!).

On other hand, using XHTML 5 will encourages authors to write well-formed markup, which some authors may find easier to maintain and Integrates directly with other XML vocabularies.

This is still under consideration, so we have to wait to the decision...

Some more tutorials and information regarding HTML 5 you can find in the W3C site here.

Code | HTML
Posted by: Eran Nachum (c)
Post Date: 1/6/2008 9:46:09 PM (Jerusalem Standard Time, UTC+02:00)
Disclaimer | | Trackback   #