MVP Site interview (full version)

MVPPartySeattle2011_thumb[1]

Yesterday there was published my brief interview in the MVP site.

http://mvp.microsoft.com/en-US/Pages/default.aspx (english)

However, it is not the full version, that I publish here. Hope you enjoy it ;)

Lluís Franco Interview

Born in Barcelona (Spain) with more than 20 years of experience in the software development sector, Lluis Franco holds a number of Microsoft official certifications such as MCP and MCTS and has been recognized as MVP the past 10 years due to his active participation and moderation of the Spanish MSDN forums since 1997.

Lluis currently works as project development manager at FIMARGER a financial services company based in Andorra, where he founded the AndorraDotNet user group in 2007, being the first and almost unique user group based in this country.  Since 2010 he is also the president of the Andorra IT Professionals Virtual Association.

He maintains several blogs and is a regular host and speaker in local events in the region, such as the “Geek-A-Paloozaa” conference that took place in April 2012. He also contributes articles to the technological section of a local newspaper.

He resides in Andorra for more than 20 years, he is married and father of two girls.

1. What does it mean being an MVP?

It is something much more important to me now than when I was first awarded, as I wasn’t aware at that time of all the wonderful things that would happen to me and the great people I would meet over the time. Not only at a technical level, what the MVP community of course has, but also for the human quality of the majority of MVPs. I met many of my current best friends thanks to the MVP Program.

2. How was your start in the community?

It happened just by chance. As it was the case of many professionals in the IT industry I needed help to solve a problem and posted a question in the today disappeared Microsoft newsgroups, where I got the answer to my questions. I just loved this way of learning from other community members and one day I decided to give something back to them and I started to reply questions there. Sometime after I started running a webpage, a blog, another blog…. At some point I did a presentation at a local user group meeting and finally I started a new user group, hosting events… And I still really enjoy doing these things today.

3. What would you ask Steve Ballmer?

Let me see… The first thing that comes to my mind is to ask about some Microsoft business segments long-term strategy. But this is something that almost everybody would ask him, so I would rather ask about the good old times… So Steve, in your opinion, what has been the most important fact in Microsoft’s history? I am talking about the key factor or point in time that has made Microsoft what it is today.

4. What is the best software product in history?

I am in love with C#. For me this is the most beautiful, complete, and powerful programming language ever created. So therefore, the best software product for me is Visual Studio 2012, the best IDE in history (or at least the best I have ever used, that are many). Talking about operating systems, I have no doubt; Windows 8 is far the best one. At that point I have to say that I have not always worked with Microsoft products.

5. What would you change on Visual C#?

I would continuously add functional characteristics to it. In the latest versions we have seen the introduction of generic functions, delegates management, LINQ and moreover, lambda expressions have made of C# the programming language I have always dreamed about. It is really fun programming on C#! However some things are still missing such as Nested functions, for example. So as some of my friends mentioned to me, this would make functions to be considered 1st level citizens. There are also other things such as making the Framework and IDE a bit lighter. There are many different types of objects there and some collections could be eliminated.

6. Which is the last book you have read?

I am a compulsive technical book reader. But I also love fiction and science fiction books. I have last read ‘Ready Player One’, a novel with plenty of references of the 80’s : videogames, music, films, role games, comics and even toys. It has a young writing style and I could identify myself with the background described there. I also read technical books and of course, my favorite one: ‘The Silmarillion’.

7. Which music CD would you recommend?

Just one? In that case I would go for Radiohead’s ‘Ok Computer’. I really love this band’s the first albums. I like different kind of music from Bach to the heavy metal, including Jazz music too.

8. What makes you an excellent MVP?

I don’t consider myself an “excellent MVP”. For me being an MVP means a person with some technical skills but that is willing to share his knowledge and passion with the community in different ways, helping others that have helped them before. So the most important thing here is having the right attitude. So somebody that considers himself as being better than others because of the MVP Award probably wouldn’t deserve this recognition.

9. What is in your “Computer Bag”?

There is less and less software and more and more hardware in there. Many small devices, adaptors, that make life easier when I’m travelling. And of course, and old souvenir from the old MVP Program times, a Swiss knife with the MVP logo on it that contains a complete set of different tools, that I of course, have never used, but I hold it just in case.

10. What is the best thing that happened to you since you are an MVP?

Popularity, women, money… (I’m kidding). Maybe having being nominated as “C# MVP Of The Year 2011” as it is an Award that you can have once you are MVP and the winner is chosen by other MVPs within the same expertise. My first trip to Seattle was also great, but if I had to choose just one thing, this would be the people that you meet. There isn’t anything better than a “geeks & beers” meeting.

11. What is your motto?

It is something really simple: “Try to be a better person”, somebody able to be a model for my daughters when they will be older.

12. Who is your hero?

Sheldon Cooper, Yoda, Spock, Frodo, Cálico Electrónico and Fuckowsky from ‘Memories of an engineer’… But if I had to choose just one, this would be Tony Stark: Playboy, millionaire, genius, and with his own armor. However in real life the true heroes are those that do the most difficult thing: doing what is right under any circumstance, for eg. a child with a serious disease that encourages his parents in the bad moments…  This is really a true hero.

13. What does success mean to you?

Enjoying your daily work! In fact this would include two things: first of all having a job, what is not easy in today’s world and secondly, doing what you really enjoy for life. This is a true luck in life and what really can make you happy.

14. What would be your personal Project for this year?

Let’s see… I have already been in Seattle this year, attending to the MVP Summit, and also have organized the “Geek-a-paloozaaa” event in Andorra. So I would like to finish a series of technical posts about parallel computing that I have started some months ago, for what I don’t find the time to at this moment. In the personal side, I would like to spend more time with my loving ones.

See you :-D

Today’s review – Advanced Installer

Hi again guys! :)

Today I’d like to tell you why I decided to change my software deployment method.

ClickonceHell

I’ve spent a lot of time in the last days looking for an alternative way to deploy client applications. During this period I’ve tested different options (including the options provided by Microsoft Visual Studio) and finally I’ve decided to use Advanced Installer.

But before that I wanna tell you why I’ve arrived to this point.

My situation

As a developer I’m still building some Windows applications, because most of these applications are targeted to the business market. And well, until now I’ve been using the typical Setup projects or ClickOnce, depending on each project.

Until now.

Because ClickOnce is not the best solution for complex deployments. It’s quite good for simple or medium scenarios, but is not enough when you need to use merge modules -or equivalent-, database scripts, registry entries, launch conditions, etc.

What about Setup projects? Well, I decided not to use them anymore since I read this post. Because these modules won’t be supported in future versions of Visual Studio. If you haven’t read this post, and you’re still using it, you must read it now.

So, in the previous link you’ve noticed that WiX is recommended instead of Setup projects, but in my opinion WiX is not a valid option, because doesn’t allow neither use designers to customize the installer nor install prerequisites.

For your information: The following table compares the features of Windows Installer Setup Projects, InstallShield 2010 Limited Edition, and the Windows Installer XML Toolset.

Advanced Installer

This application provides a powerful and easy way for making your deployments via Windows Installer plattform, offering different editions: From a freeware with the most common options to an edition for architects, with lots of stunning features like integration with App-V, VMware or System Center deployments.

In my particular case I downloaded a trial version (limited to 30 days) and started to make a test with a medium-size solution, with 20 projects inside. After playing a couple of hours with the tool, I built a complete setup project, including some advanced features like: Merge modules, file associations, launch conditionals (both system and software), prerequisites, registry entries and sql scripts. And of course with complete control over the installation options and the appearance of the setup wizard.

SetupOptions

WOW! Not bad at all… And most of these options are provided by free (not all but most of them).

Coming soon

Now I’m thinking in implement some advanced features, like licensing, trials  and updates. Yes, you can implement a licensing mechanism, and not only in a simply way. You can use your own C++ DLL, or send a POST to a URL to validate the license. It sounds really good!

Another interesting feature when using serial validation allows you to make trial packages. It allows your users to evaluate your product before purchasing, and also enables users to register after they have received a valid key. After the trial period expired the user will be able to run your application only after registration.

Licensing

Finally, my favorite: Advanced Installer provides a way to check for updates. If this option is enabled, before installing the application package, a version check will be executed. If a newer version of the installation package (current MSI) is available it will be downloaded and installed instead of the current one.

My review

A stunning product, with lots of options for making your deployments quickly and easy. You can customize your setup experience in great detail and the UI helps you to create complex installation packages in minutes.

Compared with other market leaders is much easier to use and it has a shortest learning curve.

Sincerly impressed. Good job guys! :)

Advanced Installer website: http://www.advancedinstaller.com/

PS – <IRONIC MODE ON> Ok. I understand traditional Windows applications are from the past, and nowadays everybody is developing web applications or WP7/Metro applications… this kind of developments doesn’t need too complex deployments, and maybe it’s better for everybody the marketplace-based model… But there are a few people that are still developing business applications. I just wanna say… PLEASE MICROSOFT, DON’T FORGET US! :)

Amazing: Awarded MVP of the Year!

mvplogohor

Surprised. Puzzled. Amazed. These are the words that define better my current feelings.

However, while writing these lines I’m just realizing I have a blissful smile, or maybe just a stupid smile. Why? Because I just received an email from Lisa Feigenbaum (Microsoft Community Program Manager) with this message:

“Congratulations on being awarded C# MVP of the Year based on your contributions in 2011!”

WOW! That’s amazing, and sincerely, totally unexpected

For the last 9 years I have been awarded a Microsoft MVP, and believe me, that’s something very important for me. Maybe not for being recognized as an ‘expert’ (it is hard to use that word while there are so damn good people out there), but because they recognize the work of helping the community.

So now, in a private survey all the C# MVPs around the world and the product team have decided to recognize my contributions with the ‘C# MVP of the year’ award, whatever that means.

On the next March 2nd there will be an honorary dinner sponsored by S. Somasegar (“Soma”), Senior Vice President of the Developer Division at Microsoft, with other executives and community leads in the division. Unfortunately, I won’t be able to attend because I come back from Seattle the same day in the morning. Nevertheless I promise you while I am in Seattle I’ll try to have a beer with some of these guys.

From here I’d like to congratulate the rest of the winners (there are 29 in all categories) and thank all my colleagues. Hey people, you’re great!

Kind regards from Andorra,

PS – Next week I´ll start telling you my experiences @ Seattle.

Windows 8: Microsoft’s full ARM tablet demo

Microsoft introduced a number of tablet concepts during a partner preview event earlier this week.

win8tabletarmpreview

The software giant held a technical demonstration at Computex on Thursday to demonstrate Windows 8 to hardware partners. Mike Angiulo, corporate vice president of Windows Planning, Hardware and PC Ecosystem at Microsoft, demonstrated Windows 8 on a variety of tablets. Angiulo showed how Windows 8 works across x86 and ARM-based chips. Microsoft previously introduced a technology preview of its Windows ARM support by showing off an early build of Windows 8 at CES 2011. Microsoft is partnering with ARM-based manufactures NVIDIA, Qualcomm and Texas Instruments to produce new Tablet devices.

See the full article and video al Winrumors:

http://www.winrumors.com/windows-8-watch-microsofts-full-arm-tablet-demo-video/

Edit: My friend Hadi just tweet about more videos on Windows8:

Hadi Hariri

More Windows 8 Videos: http://hadih.me/jXI0ip

Windows 8 first ‘official’ preview

REDMOND, Wash. – June 1, 2011 – Today, at the D9 Conference, we demonstrated the next generation of Windows, internally code-named “Windows 8,” for the first time. Windows 8 is a reimagining of Windows, from the chip to the interface. A Windows 8-based PC is really a new kind of device, one that scales from touch-only small screens through to large screens, with or without a keyboard and mouse.

See the full article at:

http://www.microsoft.com/presspass/features/2011/jun11/06-01corporatenews.aspx

Edit: Microsoft made it clear last night that — contrary to expectations and rumors — the new shell is going to be the default on all Windows 8 PCs, and not just tablets. Many of us Microsoft watchers had believed it would be the default on tablets. Source: Mary Jo’s blog

Using ASP.NET Membership in SQL Azure

The scenario:

Sometimes we forget SQL Azure is not SQL Server. This morning in the project I’m working, we needed to create a small ASP.NET membership database in SQL Azure.

It seems easy! Would you expect troubles with this? Nope? Ok, me neither… until I tried to execute aspnet_regsql to create the database:

An error occurred during the execution of the SQL file ‘InstallCommon.sql’. The SQL error number is 208 and the SqlException message is: Invalid object name ‘master.dbo.sysdatabases’.

Notice that this error is absolutely normal, because in SQL Azure we can’t access to sysdatabases table. In fact, if we try to execute this script:

SELECT * FROM master.dbo.sysdatabases

We will receive this error:

Reference to database and/or server name in ‘master.dbo.sysdatabases’ is not supported in this version of SQL Server.

The solution:

When using SQL Azure we cannot create the database with aspnet_regsql. Instead, we should use a new set of scripts optimized for SQL Azure.

There are a couple of files to download, but we only need InstallAspSchema.zip which contains all the needed scripts separated by themes (memberships, roles, etc.) which I think is great! So we will install only the parts that we will use:

aspnet_scripts

The most important step is installing the scripts in the correct order. The first one must be InstallCommon.sql, and after (in my particular case) installing the InstallMemberShip.sql and InstallRoles.sql scripts is -by far- enough.

Note: Be aware with the scripts, I’ve had to execute the membership script twice, because the first one some tables haven’t been created. If you have the same problem please send me feedback about it.

Hope you enjoy it! :-)

More info:

ASP.NET Membership scripts for SQL Azure:

http://archive.msdn.microsoft.com/KB2006191

General Guidelines and Limitations (SQL Azure Database)

http://msdn.microsoft.com/en-us/library/ee336245.aspx

Macbook Pro – Series 3400 series chipset usb problems?

After a long time… here we go again!

Today a quick post, just a note:

If you bought a MacBook Pro and you would like running Windows 7, it could be possible experiment some chipset problems. In my particular case with USB and bluetooth devices (Wireless Notebook Presenter 8000), and a couple of window-freezed.

Also, in some ocasions Windows threw an error: “Intel 5 Series/3400 Series Chipset Family USB Universal Host Controller – 3B3B (and 3B36) has a driver problem”.

After navigating 10 minutes I just realized that lots of people are experimenting the same trouble, and I would like to show how to solve it in 3 simple steps:

  1. Open your ‘Device Manager’
  2. Show all devices (including hide devices, View menu)
  3. Disable both devices (3B3B & 3B36)

That’s all! :-D

Hope you enjoy this. Leave a comment if this post has been helpfull ;-)

How to: Grouping groups

GroupPolicy

Today I would like to show a tip for grouping active directory groups using LINQ to objects.

Suppose this scenario: You wanna retrieve all the roles a user belongs, grouping them by their domain name, as shows:

Groups under:
– Group name: All
– Group name: LOCAL
Groups under: BUILTIN
– Group name: Users
– Group name: Administrators
Groups under: PRIMARY_DOMAIN_NAME
– Group name: xxx1
– Group name: xxx2
– Group name: xxx3
– Group name: xxx4
– Group name: xxxN
Groups under: NT AUTHORITY
– Group name: INTERACTIVE
– Group name: Authentified users

(*) As you can imagine, some names have been deleted for security reasons :-)

We can accomplish this using only one LINQ to objects sentence, and a couple of extension methods (extending the NTAccount class):

public static IOrderedEnumerable<IGrouping <string, NTAccount>>
    GetGroupsUnderDomains(this WindowsIdentity identity)
{
    var groups =
        from grIdentity in identity.Groups
        where grIdentity.IsValidTargetType(typeof(NTAccount))
        select grIdentity.Translate(typeof(NTAccount)) as NTAccount into ntAccounts
        let domainName = ntAccounts.GetDomainName()
        orderby domainName
        group ntAccounts by domainName
            into domainGroups
            orderby domainGroups.Key
            select domainGroups;
    return groups;
}

public static string GetDomainName(this NTAccount account)
{
    string[] split = account.Value.Split('\\');
    return split.Length == 1 ? string.Empty : split[0];
}

public static string GetAccountName(this NTAccount account)
{
    string[] split = account.Value.Split('\\');
    return split[split.Length - 1];
}

Awesome! LINQ rules :-)

If you would try this code, it’s quite simple:

var groups = WindowsIdentity.GetCurrent().GetGroupsUnderDomains();
foreach (var dg in groups)
{
    Console.WriteLine(string.Format("Groups under: {0}", dg.Key));
    foreach (var g in dg)
    {
        Console.WriteLine(string.Format("  - Group name: {0}", g.GetAccountName()));
    }
}

HYEI, happy coding!

December 2010

How to: Check if current user is member of ‘domain admins’

The scenario

Sometimes in business applications it’s interesting checking if current user is member of the ‘domain administrators’ role. For example I am used to checking if current user has administrative privileges in order to showing some advanced configuration options (changing the application’s connection string, or allow creating new users).

privileges_thumb

IsInRole

To acomplish this we could use WindowsPrincipal class and its IsInRole method (this method checks if an user is member of a Windows role and returns a bool value). One of its overrides allows to pass the SID of the role or a constant value based on the enumeration WindowsBuiltInrole.

Note: For performance reasons, it’s recommended to use the override: IsinRole(SecurityIdentifier).

To check if current user is a local administrator we only need to do this:

WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());
return wp.IsInRole(WindowsBuiltInRole.Administrator);

Notice that it’s realy easy, but as -its name indicates- WindowsBuiltInrole enumeration only contains local roles. So, if we would check if our user is member of a domain group, we should find the role SID, and then copy this value in our code.

As you can imagine, this is not the best solution, isn’t it? Well, let’s investigate a little bit more…

WellKnownSidType

Let’s take a look at the following enumeration WellKnownSidType, this enumeration provides commonly used security identifiers. Uhm… sounds good! Let’s try to use it in our code:

WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());
SecurityIdentifier sid = new SecurityIdentifier(WellKnownSidType.AccountDomainAdminsSid, null);
return wp.IsInRole(sid);

Do’h!It seems that we need to pass the second argument called DomainSId…

CurrentUserIsDomainAdminError

DomainSid

What the hell means DomainSId? At MSDN we can read a brief explanation: Represents the domain SID, and this value is required for some WellKnownSidType values.

At this point our goal should be know the domain SID, but wait… how can I retrieve the domain SID? After spend some time surfing the Internet, the only solution I could find was an utility called PSGetSid from Mark Russinovich inside PSTools components. If you want try it, you can download this utility and execute it from your console to know the SID of your domain (type your domain name as “microsoft.com” o “net.volvo.com”):

DomainSidConsole_thumb

However, I’m pretty sure exists a better solution to this issue. Thus, let’s try to ask to our domain their SID, using the namespace System.DirectoryServices:

Domain d = Domain.GetDomain(new DirectoryContext(DirectoryContextType.Domain, getDomainName()));
using (DirectoryEntry de = d.GetDirectoryEntry())
{
    byte[] domSid = (byte[])de.Properties["objectSid"].Value;
    string sdomainSid = sIDtoString(domSid);
    Console.WriteLine(sdomainSid);
}

Here we need a couple of auxiliar methods. The first one retrieves the domain name, and the second one retrieves a string that represents a SID value (from a byte array).

public static string getDomainName()
{
    return IPGlobalProperties.GetIPGlobalProperties().DomainName;
}

public static string sIDtoString(byte[] sidBinary)
{
    SecurityIdentifier sid = new SecurityIdentifier(sidBinary, 0);
    return sid.ToString();
}

Then, the value of sdomainSid corresponds to the SID of our domain. Great! Now, we can use it to retrieve the SID of the domain administrators role.

Putting it all together

Like my collegue and friend @alegrebandolero, I’m also a fan of extension methods. So, let’s create an extension method for the WindowsIdentity class:

using System.DirectoryServices;
using System.DirectoryServices.ActiveDirectory;
using System.Net.NetworkInformation;
using System.Security.Principal;

namespace TestAD
{
    public static class SecurityExtensions
    {
        public static bool IsDomainAdmin(this WindowsIdentity identity)
        {
            Domain d = Domain.GetDomain(new
                DirectoryContext(DirectoryContextType.Domain, getDomainName()));
            using (DirectoryEntry de = d.GetDirectoryEntry())
            {
                byte[] domainSIdArray = (byte[])de.Properties["objectSid"].Value;
                SecurityIdentifier domainSId = new SecurityIdentifier(domainSIdArray, 0);
                SecurityIdentifier domainAdminsSId = new SecurityIdentifier(
                WellKnownSidType.AccountDomainAdminsSid, domainSId);
                WindowsPrincipal wp = new WindowsPrincipal(identity);
                return wp.IsInRole(domainAdminsSId);
            }
        }

        private static string getDomainName()
        {
            return IPGlobalProperties.GetIPGlobalProperties().DomainName;
        }
    }
}

That’s all. Now, use it as follows:

if (WindowsIdentity.GetCurrent().IsDomainAdmin())
{
    //Some actions…
}

Edit 12/14/2010: Since Windows Vista, each Windows user have a couple of security tokens. The first one is the normal token with limited privileges, and the second one only works when you ‘run as administrator’. This code only works if you are using the second token, running the application as administrator.

HYEI, happy coding!

December 2010