Dobkin's Place

Saturday, June 02, 2007

New blog

Latly i have moved my blog to new location under Microsoft.
the new link is ndobkin.
You can find me there.

Saturday, March 10, 2007

Manage your web projects deployment

We all know how to extent and run MSBuild with our library console and forms applications, but what about the web applications?
Dose anyone ask himself once – where did the .proj file of my web project gone?
To solve this mystery Microsoft has come with Web Deployment Projects.
Now by simply clicking on our web project and editing a Web Deployment Project
you get a .wdproj, which is exactly functioning like the .proj file. And you can you it advances oprions to manage your section in the config file depending on the compilation mode (release, debug or add one of your own - like "dev" and "prod")

This dude covers this all topic.

Tuesday, February 27, 2007

MSBuild Logger Verbosity

When you build your .net 2.0 projects there are notes appear in the Output window. Those notes are generated by the MSBuild engine. By default the verbosity detailing level of those notes is very common and don't include all the output that given by MSBuild.
You can change the verbosity detailing level by changing the following key in the registry

HKEY_USERS\S-1-5-21-57989841-1409082233-839522115-1003\Software\Microsoft\VisualStudio\8.0\General

key value named MSBuildLoggerVerbosity.

There are four levels, the default is 2. If you want to see the messages then you have to set the value at least to 3. I don’t recommend setting the 4 level because then the amount of output is enormous and it is very hard to find something in it.

Monday, February 26, 2007

Extending the build process – GacUtil task

As part of planning a daily build process I needed to register the current assembly to the GAC. I was Surprised to find that there is no such a task that came with the VS tasks kit. And I was event more surprised to not find such a task in the common extension tasks kit for MSBuild. So I said "This all mechanism is so easily extendable so why no write a task for my own to cover this issue? – and practice in writing MSBuild tasks in the way". So that's what I did.
I write some custom task called GacUtil which get two parameters:
Assemblies – a list of assemblies to work with.
Command – the operation that should be made on the assemblies, Install or Uninstall.

You can use the command by simply add the "using task" attribute in to your .proj file for example.

<UsingTask TaskName="CostumTasks.GacUtilTask" AssemblyFile="$(SolutionDir)\CostumTasks\bin\Debug\CostumTasks.dll" />

And call the task that way

<gacutiltask command="Install" assemblies="$(TargetPath)"/>

The more recommended way is writing your own .tasks and .targets files, and put all your references in it.
The naming standard for such files is [companyName].targets/tasks.

You can download the source code and the .tasks and .target files from here and start work with them.

Friday, February 16, 2007

Daily Builds

I have started learning a while ago about automatic build tools. The purpose of such tools is to automate the build process of your application to determinate time interval - let say once a day. The benefits of such a process are:
1) Every morning you have most up to date application running in your test server.
2) In some future scenarios every morning you can get a list of all the tests that not run well by your unit tests.
3) Because the build process is occurring every day, its make a high quality level of the code made by the programmers' in order to keep the application work every night.

Apparently there is no shortage on the market of such tools. I chose the most common ones that used in the market.

1) MSBuild
2) NAnt
3) Cruise Control .net

After some testing I figure it out that all those tools are giving pretty much the same capabilities, all those tools define a new XML base language that uses targets to combine logical blocks and tasks to do atomic actions like copy directory, get latest from a safe source or open a new virtual directory in IIS.
Some tools, like Cruise Control .net give some extra capabilities like running automated build based on triggers like file change of check in to the safe source, but the base concept is the same.

I chose to concentrate on MSBuild, and it's not because I am a Microsoft freak it's because there is no benefits to the others tool on this one and I prefer to be sure to have support further on.

I did a presentation to my teammates about MSBuild and its concepts. So check it out.
MSBuild Presentation

By the way I forget to mention that all those tools are completely extendable by writing custom tasks and for each tool there is a large community that supports it and helps to solve issues.

Msbuild
NAnt
Cruise Control.net
more links are supplied within the presentation.

Have a nice work.

Saturday, February 10, 2007

A great day at work

A couple of days ago I got a chance to be part of something amazing. I am working as a programmer for almost three year and I never been a part of something like that.

The story goes like this. As part of a new project that me and my team just started, we checking some tools and programs that we can get help of to manage faster development. In fact, one of our departments has an application that they have developed a while ago which almost completely covers one part of our project. So we ask them to come and install their application for us that we could check it.
The installation was compounded from two parts:
1) Installing an application's scheme of SDE – which is ESRI's answer for geo database.
2) Installing the application on one of out PCs, including some special configurations.

Although this is sound like common installation for every, or almost every, application, it is important for me to notes that our departments work in completely different environments almost without partnership; in fact this was one of the very few projects that those two departments took part in, and it's a great achievement for our company for its self.

My job in this story was to accompany the installation process and learn about it.
The other department sent a programmer and a DBA to handle the job. After couple of hours of standard installation drill the application, and it's all components, were installed. The DB was created including the necessary scheme. And we all site there and say our prayers that the application will work. But as you probably know it's never work for the first time… and apparently for us it didn’t for the second and the third also.

After a while and some tries in different directions we got a conclusion that there is a problem with some part of the code. But because the installation, as it should be, included only the dll's, without the source code, it was impossible to run a debugging process and see what is going on down there.
As I saw that they have some debugging issues, and because programming is our field, my team leader, Shani, and myself immediately run to help.
With some help of the Reflector we managed to take out the suspicious code and try to run it in deferent solution, after a while we discovered the problem, which by the way was a problem with the user mane that we taking from the active directory. After that it's all was working.

So you probably asking yourself "what was so amazing in this process... its sound like programmer common day". Don’t you?
So I tell you. During this process I learned about security and programming patterns. About advantages of the operations system that can be easily used which I had no idea about them. Also I learned about some cool tools that make my work easier and my applications stronger. But the most important thing that I learned from that event is that a huge amount of knowledge was lying under my nose and I didn't even have idea. And did I mention all this was in one day?

So I had a real great experience working like some kind of per programming with my colleague fellows and my conclusion to you is always look for a way to improve your work and yourself from your surrounded circle - friends, workmate, family or just cool dudes that you met in the local bar.

Take care.

Monday, December 04, 2006

A maple cake recipe

Yesterday I had munch for something sweet, so I made a maple cake.
The recipe is very simple:

The groceries are:
3 eggs.
2 vanilla sugar packages.
1 1/4 glasses of flour.
1 cap of sour cream (about 140g).
3/4 glass of sugar.
1/2 glass of oil.
Maple syrup

For decoration - almond.

Combine all the groceries (without the maple syrup), by the order they are written until you got smooth dough. Move it into two English cake patterns. Bake it in oven, that been warmed ahead for 180C, for about 30 minutes. Take out the cakes after they got brown and a splinter that you stuck in stays dray. As long as the cakes remain hot, put a generous amount of maple syrup on it (and make sure that some makes it way to cake's sides). That's it.

For decoration (really recommended) – cut almond for little slices, roasted them on dray pan for couple a minutes and put them on the cakes.

Bon appetite.


Wednesday, November 08, 2006

Const vs. Static Rreadonly

If you declare a variable, within the same scope, using those declaration statements you got the same result – a variable that is initialized in declaration and can't be modified after. So what really the difference?
The main difference is in the way those two declarations are compiled. Const statement saved in to the project output in compile time as is, and static readonly statement is set only when it's evaluates first time at run time. In fact what is saved within the project output is a link to this field and not the data itself.
The way this little difference affects us is: when we use a reference to pre compiled assembly. We change the value of the const filed and recompile the assembly without recompiling our core project (which uses this reference). The change, which we have just made, won't take place because the const value has been already saved within project output. As opposite to static readonly field, which modification will take palace in referencing project, without recompiling it.

Bottom line, declaring variables as static readoonly is more efficient and safe way to declare non modified variables for your module.

Friday, November 03, 2006

Add source control options to VS 2005

If you install your VSS (or any other source control) after you have installed the VS 2005, the VS 2005 have no binding to this source control and options to handle the control won't appear in the menu.
To enable this go to – tools/source control, and select your source control in the drop down list. After that the options appear under File menu and you could use you source control happily.

Thursday, November 02, 2006

ESRI 9.2 products - new features

Hi, this week i was at Systematic conference that took place in tel-aviv. Systematic is presentat ESRI's products in israel.
there are the most importent issues that i took from there.

Changes with SDE
There are three new geo databases:
1. Personal SDE – support up to 1 user editing and 3 users viewing
2. WorkGroup SDE - support up to 10 user editing and 10 users viewing.
Build on base SQL server express and have its limits, like each database file can be up to 4G and etc.
3. File Geo Database – all the geographic data saved in system files, this Geo Database is about to take place of the personal Database, which was based on Access. the access to system files much faster and there is no more capability problem that is very familiar with Access.

There are all package of store procedures for Oracle that allow include in the SQL statements geographic information for instance: get all the cities in the radius of 1000 meter from the current city, Insert synagogue in the given location – by pasting to the statement the X,Y coordination
This is a big step for developers, before that if want to add some geo information to the SDE you have to use Arc objects or one of ESRI products that give some kind of API that do the same thing behind the curtain.

There is improvement of projection on the ply for the shape files which coordination system is different from the other feature classes/ rasters in the same data frame.

Gis server 9.2
Support 3D display (included only in the advanced license)

There is new GIS manager, a web based application that allows you in a few clicks create a VS 2005 web project with GIS capabilities - Nice to have tool and maybe good for small and basic application but if you want to add some extra functionality then there is no escape, code must be added.
The manager can be found at: http://localhost/Arvgis/manager/somthing...

Image server
The main purpose of this tool is the give raster services for multi-users, the server can be accessed from web projects, desktop products, application that based on IMS and etc.