Friday, August 22, 2008

Vista batter saver got Danish locale! + RC2 branch

Great thank (how will it be in Danish?) to Bjarke Istrup Pedersen for Danish translation of Vista Batter Saver.

Download public beta 2 r2 with Danish locale >>

If you would like to take a challenge and test new RC2, you can do it also (no locale yet). It includes additional functionality and dozen bugs fixes.

Download latest RC1 >>

Tuesday, August 19, 2008

I'm leaving consulting field - joined new project for full time

Dear readers,

I leaved mPrest, the company, I worked for last 5 years and joined the project, that aspires to make the World better. Currently, I cannot disclosure too much, but briefly, I will not consult and manage client's projects anymore. This does not mean, that I'm quitting Microsoft and it's technologies, I'm just beginning to develop product(s).

Also, I'll keep blogging. It will be probably less "problem solutions" and more "how the stuff works", but actually, I'll blog less. In addition, I promised to Microsoft, that I'll contribute some of my time for community activities such as lectures, QnA sessions, presentations and open source activities. But this will be only small part of my time. Mainly, I'll work to accomplish my project.

All my contact information remains the same, so, if you have urgent questions, you can ask. Also, if you want to be in touch more, you can follow me in Twitter.


© Image copyright by National Geographic, photographer - O. Louis Mazzatenta

Thank you, and keep reading...
Tamir

Tuesday, August 12, 2008

WPF DataGrid CTP is here. It’s also open source!

Huge amount of people asked me about DataGrid control in WPF. There are some 3rd parties providing this control for free and not, However, I always adviced them to wait until Microsoft will release it with (or after) Arrowhead. So here comes the King. Some boys and girls from MS WPF dev team have OS initiative and released WPF toolkit. It’s absolutely free and includes all sources. Also it renewed with WPF DataGrid CTP and other tasty Futures inside with full source aside.

Microsoft goes open source? It does!

image

Download latest WPF toolkit >>

Monday, August 11, 2008

.NET 3.5 SP1 is RTM and available for download

For all those who asked, .NET 3.5 SP1 is final and available for download. What’s inside?

  • ASP.NET Dynamic data
  • Core improvements for CLR
  • A lot of performance improvements in WPF
  • ClickOnce enhancements
  • ADO.NET with Data Services and Entity Framework
  • LINQ2SQL and Data Provider for SQL Server 2008, that was released last week
  • WCF with easier DataContract serialization

Download it with Web Installation or as Full Package

For more information, please see Read Me and KB about .NET 3.5 SP1 RTM. If you faced with any issue, please provide us with feedback via MS Connect

Friday, August 08, 2008

Expert days – last minute changes

Next week we’ll starting Expert Days, so you have a last chance to register for Windows Presentation Foundation for fellow developers (12-Aug) and Mastering Microsoft Silverlight 2.0 (13-Aug). Those sessions will take place in Bein-Thumi Herzeliya and start in 8:30.

We have not enough participants to open Advanced .NET 3.5 SP1 (14-Aug) [not enough people know WPF so far in Israel?], thus I would like to propose another kind of session – something like we used to do in Dev Days. You’ll come with your WPF applications, prepare to ask questions about problems with those apps and we’ll solve it together during the day. I will not have slides for this session – it will be live QnA+Discussions meeting. This specific session will take place in Megamot college in Petah-Tikva (not in Bein-Thumi, like all others). What do you think?

Last notice, if we will not have at least 26 attendees (currently for this session we have only 10), neither Advanced .NET 3.5 nor WPF QnA will be opened. Also, all people registered for those sessions will be refunded. So, now you will choose whether and which session about WPF we will open Thursday next week.

Wednesday, August 06, 2008

Tech*Ed SA is over – thank you

So, Tech*Ed South Africa is over, and I want to tell thanks to all attendees - presenters and visitors. The event was great as well as the organization.  As usual, my Visual Studio just stopped working between sessions yesterday, so I had to reinstall it during one of sessions to be ready for next one. Also in XNA session XBOX deployment did not worked for some reason and bandwidth was awful, so this fun session was not very effective. However, how it can be interesting without those technical problems?

Visitors, it was very fun to read feedbacks. Here just snack preview of it (not including comments like “Enjoyed”, “Brilliant”, “Nice!”, “Exceptionally good”, etc…:

“Level 300? Should have been marked as a 200?”
”Now this was 300 Advanced level”
”The description said Advanced but if was very very VERY advanced”
”I was definately in the wrong session coz I am only a begginner in Reflection and this was a 300 Advanced session... my bad :-)”
”The speaker was very well prepered, thus did not strukkel to speak. i understand the topic very well, but still enjoyed the talk.”
”sometimes he sounds more like Borat than a knowledgeable speaker. There were a number of sniggers in the audience at his comments, which distracts from the content.“
”Brilliant presenter, speaks fluently and clear, not like all others. Are you from Canada?”
”Excellent, not applicable for business, but bring more of these. MORE.”
”Probly the wrong sesion for me but was interesting”
”Host's setup of machines was troublesome.”
”SA Bandwidth issues reduced the effectiveness of the demo side of things.”

Guys, please let’s set it clear (at least for me):

  • 100 – Go to sales department
  • 200 – Slides with nice pictures – no code
  • 300 – Visual Studio, Code, some slides
  • 400 – All code – almost no theory and slides
  • 500 – Machine code
  • 600 – Come offline it will take time

And now, my favorite one: “Guys,    I would like the trial versions of the following softwares:    1. Visual Studio 2008  2. SQL Server 2008  3. Expression Studio v2.0  4. SharePoint Server 2007    I would appreciate if i can get it before tech-ed closes.  Thanks and please contact me if you could assist.”. I sent you an email with links to all requested trials. Keep doing! :)

I saw about 100 visitors of my blog. They recognized me. Also when I gave my business card (with blog address), almost everyone told: “Oh, I know this blog – very good one”. Charming, that in spite of bandwidth issues, there are my blog readers in SA. If you were in my session and want to tell anything publicly, just leave a comment here.

Tomorrow noon, I’ll leave SA back home and ‘ll start to prepare to Expert Days (do you remember? It’s next week). Unfortunately, I almost had no time to see Africa, but, maybe, next time. Thank you, all again.

Hello, goodbye!

Thursday, July 24, 2008

Configuring and running Mono ASP.NET 3.5 (AJAX.NET) on Linux computers

Before we will start, we should install Linux. To do this, you can download any of LiveCDs with live installation. Officially, Mono supported only on one free Linux - openSuse. However, you can make it work on any RedHat (and its alternatives), OpenSolaris. It works, but unsupported on Debians, Ubuntu and Maemo. We’ll stick to openSuse by now.

image

Let’s install it - OS

I’m assuming, that you’re installing Linux as the only OS on the machine, so insert liveCD (it can be either Gnome or KDE) and wait for Linux to run. It will run live image directly on your machine without installation.

When it’ll up, you’ll see liveInstall icon in your desktop. Click it and skip first two screens (it is only language and local settings). Next screen (disk partitions) is necessary for us.

On this screen, first delete all automatic partitions. The only one main partition will remain (/DEV/SDA or /DEV/HDA). Next you should choose non-LVM option and then start creating partitions.

Create first partition with mount point /boot and size of 100Mb. File system for this partition should be ext3.

Create second partition with file system SWAP (you will not have mount point) and set the size twice bigger, then RAM amount.

Create last partition with mount point / and all remaining size on disk.

All other steps are optional, you can just click Next button.

After about 10 minutes you’ll have up and running openSuse system. (If you forgot to remove CD, choose HardDisk as boot option)

Web Server installation

Now we have to install web server. You can choose either Apache, FastCGI  or use build-in server within Mono – XSP. We’ll choose Apache

Goto “Computer” it’s in the same place as Start button :) and choose YaST. You’ll be asked for admin password, you entered while installing the system.

Now in the Filter field, type “Install”. Choose “Software Management” from the available programs at right. Now, when Package Selection dialog opens, type “apache”, you’ll find apache2. Select it and click Install. Apache will move to the right column. Optionally, you can install also prefork and utils packages.

Now hit “Apply” to install it. Within two minutes, you’ll be asked to log off and log on. Do it.

By now apache is not running, you should run it and set it starts automatically. To do this, enter terminal window (you can either do it from “Computer” menu or right clicking desktop).

You need elevation to administrate startup programs. So type: “su –“ and enter your password. Terminal color turns red. Type “chkconfig apache2 on”. Now you should check whether it done, so type: “chkconfig apache2 –list”. You should see “On” near number 3 and 5.

To run apache manually, just type “/etc/init.d/apache2 start” to stop “/etc/init.d/apache2 stop”, to restart “/etc/init.d/apache2 restart” and to check the status “/etc/init.d/apache2 status

We done, apache is up and running. Now we should install mono

Mono installation

Start with the same YaST but this time, type “mono” – you’'ll get a lot of programs. To simplified installation, choose (or type) mono-complete. This will all available Mono modules.

After Mono will be installed, you should install also apache2-mod_mono to make possible running ASP.NET mono pages in Apache. do this.

Log off – log on and move to configuration

Mono configuration

Now it’s time to configure what ASP.NET pages you want to run. We want ASP.NET 2.0, so we should run mono apache mode for this version. To do this, go to the terminal, elevate yourself (su –) and type following: “vi /etc/apache2/httpd.conf” This will open VI editor with apache configuration file in it.

Now it’s time to learn VI a little. To start editing, you should type “A” – it will write “INSERT” in the lower left corner. To return to the command mode, hit escape key. To save (from command mode) “:w” to exit and save:wq” to exit without save:q!”. To find/” and string the pattern you are looking for.

Now go the the very end of the file  and write under Include “/etc/apache2/vhosts.d/*.conf” following:
(to short string “[D]” is your virtual directory (slash blank is root), “[P]” is physical path to your site without trailing slash)

MonoServerPath default /usr/bin/mod-mono_server2
Alias [D] “[P]”
AddMonoApplications default “[D]:[P]”
<Location [D]>
SetHandler mono
</Location>

So, if your site is MySite and it is in /srv/www/htdocs/MySite, this section will looks as following:

MonoServerPath default /usr/bin/mod-mono_server2
Alias /MySite “/srv/www/htdocs/MySite”
AddMonoApplications default “/MySite:/srv/www/htdocs/MySite”
<Location /MySite>
SetHandler mono
</Location>

If you want to turn it to the root site, this will looks following:

MonoServerPath default /usr/bin/mod-mono_server2
AddMonoApplications default “/:/srv/www/htdocs/MySite”
<Location />
SetHandler mono
</Location>

Now, we’ll add mono administrative site to be able to restart mono only without touching apache itself. To do this, after last </Location> you should add following:

<Location /mono>
SetHandler mono-ctrl
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>

I think it’s very clear what it did :)

If you have more, then one site and want to configure mono differently for each one of those, you should add VirtualHost section. To do this, include your configuration in to

<VirtualHost [IP and port you want, for example 1.1.1.1:80 or *:80 for all IPs on port 80]>
ServerName [Name you want]

</VirtualHost>

We done. Restart apache and enter the url you set (for example http://localhost/MySite/)

Working? Good. You finished.

Not working (familiar yellow error 500 screen)? Keep reading…

Debugging Mono website

Do you remember, that you have no development environment in this machine? You can install it, or download Mono liveCD with openSuse. But before doing it, please note, that GTK# (it’s devenv) is not very user friendly. It even worse, then Eclipse. So let’s try to understand first whether we can fix small compatibility problems without entering code.

The most convenient method to debug web site on Mono is by using XSP and XSP2 mini web servers. Just enter the directory of the site and run it. By default you’ll be able to access the site by using “http://localhost:8080” (it also be written for you). Enter and notice whether you have any errors in console. No? Keep doing

The most common problem is “error 500” with nonsense stack. If it contains ScriptManager error Type not found, the problem is in Web.config file. Try to regenerate it to be compatible to Mono (for example, Mono has different version of System.Web.Extensions assembly. In ASP.NET 3.5 it has version 3.5, Mono has only 1.0.61025.0 (the old AJAX.NET). To recreate your web.config all you have to do is to execute “mconfig af AJAX Web.config” It will create default web.config file, supports System.Web.Extensions (AJAX features).

Not helped? Keep doing. Let’s look another time into the stack – if it contains errors in “EnablePageMethods” or “ShouldGenerateScript” or “EncryptString” – the problem is serialization. Mono has very limited support for JSON, XML and SOAP serialization. Try to look into your code and notice if you have classes, marked with [Serializable] or you are transferring your own classes by using PageMethods. If so, replace it with regular strings (my grandma serialization).

Person p = new Person();
string sstr = string.Format(“{0}|{1}|{2}|{3}”, p.FirstName, p.LastName, p.Age, p.Wage);
return sstr;

var sstr = persons[i].split("|");
var p.FirstName =  sstr[0];
var p.LastName =  sstr[1];
var p.Age =  sstr[2];
var p.Wage =  sstr[3];

Not helped? Try to rename “Bin” directory into “bin” “mv Bin bin –r”. Actually this was fixed in latest versions of Mono, but who knows?…

No? Check whether you have partial classes, which is not supported by Mono. If so, recompile it like this

mcs /t:library /out:bin/test.dll –r:System.Web –r:System.Data –r:System.Web.Services –r:System.Web.UI.Controls test.aspx.cs

If you have Generics in your code, you should use gmcs, rather then mcs.

Not helped? It looks, that you have to either install Mono on your Windows machine and debug your code with it. Or, alternatively install GTK# and do in on Linux.

But wait, before doing such big step, install and check the binary compatibility of your code. To do this, you need “Moma” – a simple tool, that tell you if everything is ok for Mono in your assemblies.

Good luck and see you in my forthcoming TechEd session, where I’m presenting openSuse, running UDP multicast server with ASP.NET 3.5 extended methods (It uses recompiled ISAPI filters for apache, rather then regular limited AJAX support in Mono)

Have a nice day and be good people.