Blog Stats
  • Posts - 40
  • Articles - 0
  • Comments - 14
  • Trackbacks - 0

 

Friday, April 18, 2014

A full day of architecture conferences in Montreal !


On Saturday May 10th, our usergroup is offering it's members a full day of conferences on emerging architectures including architectures for cloud based solutions! You have to be a member of .NET Montreal to attend and there is a 10$ fee. All conferences will be in French. http://www.meetup.com/dotnetmontreal/events/134828202/

Sunday, April 13, 2014

Meeting Azure - Top Azure features every ASP.NET developer should know about


On Monday April the 28th in Montreal comes the father of the first Azure UserGroup, Bill Wilder. Bill comes from Boston for this event and we know this is going to be a meeting the montreal devs won't want to miss... http://www.meetup.com/dotnetmontreal/events/135071842/

Friday, March 21, 2014

SQL Server 2014 launch event in Montreal !


On Saturday April the 12th, in the Microsoft Office in Montreal will be a full day of SQL Server 2014 presentation to mark the launch of this great product. The product is actually available on April 1st (no April fool here). For more information checkout: http://www.meetup.com/dotnetmontreal/events/139950192/

Wednesday, March 12, 2014

Surface 2 replaced !!!!


Hi all, if you have your receipt either paper or hopefully the electronic one sent to your email address, you should be able to walk up to the company store nearest to you and have your Surface 2 replaced for free. Mine got replaced but I had to pull some strings from the MVP program and I tend to believe not every MS Customer is an MVP... It took roughly 3 months to get it all sorted out but in the end, I have a brand new Surface 2 and it works like a charm :)

Wednesday, December 18, 2013

No serial number on my brand new surface...


Hi everyone, I thought I'd share my current experience for those of you who might be in the same position as I am right now being : I own a Microsoft Surface 2 (RT) and cannot find the serial number on it.... So before you reply and tell me how dumb I am for not being able to see the serial number under the stand, please take a deep breath and read below.... My Surface currently reboots constantly. I push the button on top, then half a second afterwards the SURFACE word appears for another half a second and bam.... reboot... and one second and reboot and on and on and on... So I said ok, I got a problem but it's no big deal since the Surface comes with a one year warranty. All I need to do is find my serial number... It's either on the original box which I'm sure everyone keeps just in case or under the stand between the "Surface" and "32GB" or "64GB" writing... which apparently I do not have... How can that be? Alright so I need support for my surface but the number one step in registering for support is providing your serial number... I don't have one... I may be out of luck but I still reached out to a few other MVPs and together we reached out to Microsoft through our direct links there (not the support line) and they apparently will keep us posted when they figure out why some Surfaces don't have a serial number... Another MVP in Montreal has the same problem as I have with having no serial number on his Surface so this might help. I will post here as soon as I have news of what should one do if their surface has no serial number and they need support but for now, we wait. Alright that's it for today, hope I can post a solution to this problem here soon ! Happy "Surfacing" all!

Tuesday, November 26, 2013

Creating your own dispatcher thread


I haven't posted here in a while and see the final result is ridiculous... Guess I'll have to learn those fancy posting tags.... Alright I know there are a lot of tools out there built for integration test purpose but I figured I would post what I think could be considered a poor man’s solution for integration testing but which works amazingly well… I’m using MSTest as the harness for starting my integration test and the solution I’m building is a WPF 3 tiered app built using the MVVM pattern. So basically I’m supposed to instantiate ViewModel classes and populate their fields and collections so I can effectively fire up the appropriate commands and get my test to actually do something. My main problem is that these ViewModels are full of async and await calls which means those commands have to be fired on a different thread than the thread on which the unit test runs, otherwise, my unit test end before the async code completes. This also means I need to wait for that other thread to finish before I can go on with the rest of my integration test. Add to that a bit more complexity to the mix, our homemade set of tools to fire commands using async and await do force that call to be made on the dispatcher thread of WPF… Is there such a thing as a dispatcher thread when running tests using MSTest???? Nope… So you need to create your own dispatcher thread and tell the .net framework that this new thread is the one that should be considered the dispatcher thread… Here’s the code I used for that and a few justifications as of why I did this and that : internal Thread CreateDispatcher() { ManualResetEvent dispatcherReadyEvent = new ManualResetEvent(false); var dispatcherThread = new Thread(() => { // This is here just to force the dispatcher infrastructure to be setup on this thread Dispatcher.CurrentDispatcher.BeginInvoke(new Action(() => { })); // Run the dispatcher so it starts processing the message loop dispatcherReadyEvent.Set(); Dispatcher.Run(); }); dispatcherThread.SetApartmentState(ApartmentState.STA); dispatcherThread.IsBackground = true; dispatcherThread.Start(); dispatcherReadyEvent.WaitOne(); SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext()); return dispatcherThread; } Now a few comments on the above… Why do I need to synchronize my code with a ManualResetEvent? Because I need to make sur the SetSynchronizationContext call is executed after the threadstart action executer this very important line Dispatcher.CurrentDispatcher. Note that the action inside that call does not need to be done executing, in fact in my case the action does nothing! Simply touching the Dispatcher.CurrentDispatcher method is enough to set the current thread as the dispatcher thread. Another very important thing for me was to set the current apartment of the new dispatcher thread to STA so it would reflect the real apartment of a UI thread in .net. Now all I need to do going forward is to pass this thread around to this method when invoking async actions: Dispatcher.FromThread(myDispatcher).Invoke(someAction). Of course, you’ll need a way to wait for this newly fired action to complete but that I cannot help you with and your code should already provide sufficient ways to do so… Hope this will help someone out there! Happy coding all.

Tuesday, April 9, 2013

Ottawa Code Camp Approaching even FASTER !


Hello all,

 

 just wanted to point out that the Ottawa Code Camp will be held on May 4th 2013 at Algonquin College.

My session will be on "Optimizing your 3 tiers apps with current technologies" and we'll take a look at WCF Threading, Tasks Parallel Library and Async-Await pattern.... all that in VS2012...   Please note that all this can be done in VS2010 if you apply the Async CTP 3 in your environment.

Here are the details: 

http://www.ottawacodecamp.ca/pages2013/default.aspx

Thursday, April 4, 2013

Dev Teach Toronto coming FAST !


Announcing DevTeach Toronto / Mississauga, May 27-31, 2013 !

Lots of great conferences during the main event and also many pre/post conferences, don't miss out on a training you can't get anywhere else !

 

http://www.devteach.com

 

 

 

 

Saturday, March 30, 2013

Exception handling when using Tasks


Tasks are very impressive once you manage to wrap your head around a few concepts.  One subject I’d like to cover in this post is how to deal with exceptions in tasks.  There are a few pitfalls one must not fall into when dealing with exception handling in tasks.  First you must remember that each task is responsible for its own error checking or error handling.  Tasks that do not handle their exceptions will crash your application.  How can you avoid that?  Continuations to the rescue!  There is a concept called Continuations in Tasks and they can easily be implemented to help you deal with exactly that type of problem.  All you have to do is “Continue” your task once it's done executing.  The continuation code (typically an Action<Task>) is the right place to check if an exception happened during the execution of the original task.  There comes the concept of “Observing” a task.  A task is deemed “Observed” if you check for it’s Task.Exception property.  For example,  look at the code below where task1 is continued so that exceptions can be caught.  Inside the continuation, you check to see if an exception occurred in task1 like follows:

 

var task1 = Task.Factory.StartNew(() =>

{

    throw new MyCustomException("Task1 faulted.");

})

.ContinueWith( (originalTask) =>

    {

        if(originalTask.Exception != null)

            {             

                                Console.WriteLine("I have observed a " + originalTask.Exception.Tostring());

}

    });

 

Task1 is now Observed and will not crash your application when it throws the exception.  Would there be other alternatives to this?  Yes, a better way of handling the above would be to pass in the OnlyOnFaulted option to the continuation task (and skip the null check) so the continuation would only happen when the original task is faulted.  Another way would be to NOT use the Continuation at all and having previously hooked your code to the TaskScheduler.UnobservedTaskException global event hanler .  This event is your last chance to log the exception before your application possibly crashes.  Of course, for the application not to crash you'll need to call the SetObserved method on the UnobservedTaskExceptionEventArgs parameter of the event.  Typically I recommand that you use Continuations on each tasks AND hook up to this "Global Task Handler" as an additionnal safety net.

Happy coding all !

 

Saturday, January 5, 2013

How I got burned with Automation Ids and virtualized content in XAML controls...


Not so long ago on our project at work we had to create shared steps in Microsoft Test Manager
for playback later on.  The screen we used contained 2 instances of the same custom made combobox
both displaying a list of countries.  One was located at the top of the screen and the other one at the bottom.
The combobox already supported Automation IDs and could " auto-magically " generate the right
automation id for each entry to be displayed in the list portion of the combobox according
to the key of each element to display, in this case, the country name.  Remember that this portion
of the control is VIRTUALIZED.

Now, the interesting part... We record our test in MTM and in this simple test, we pick a country from
the list of countries at the bottom of the screen.  We had done enough recording and coded ui tests
on this control to know it worked great... When came the playback time, we saw our recording do exactly
what it was supposed to do, pick the country we had selected EXCEPT, it did in in the upper combobox instead
of the bottom one!  HMMM.... How weird!  Both controls had different Automation IDs but had the same automation
ids for the virtualized content because they both displayed the same kind of information being, countries...
 

OK so the solution was simple, concatenate the controls unique Automation ID with the
unique content for each virtualized row...

The code behind for the control overrides PrepareContainerForItemOverride like so:

 //Declare this property inside your control and initialize it inside your constructor
 public BindingBase BindingAutomationId { get; set; }


 protected override void PrepareContainerForItemOverride(DependencyObject element, Object item)
        {
            base.PrepareContainerForItemOverride(element, item);
           
            DataGridRow row = element as DataGridRow;

            //Can't put these lines in the constructor because the GetAutomationId call returns NULL consistantly from inside it
            if(string.IsNullOrEmpty(this.BindingAutomationId.StringFormat))
            {
  //The magic is here
                this.BindingAutomationId.StringFormat = AutomationProperties.GetAutomationId(this) + "_{0}";
            }
           
            row.SetBinding(AutomationProperties.AutomationIdProperty, BindingAutomationId);
        }


So now each virtualized content inside this control has a unique automation id and the playback works perfectly.


Hope this saves you a ton of time trying to figure out why your playback won't pick the control you selected during the recording phase.

 

Wednesday, September 26, 2012

Files for .NET Montreal and VTCC4 conference


Hi,

 here are the files for both the .NET Montreal presentation made Sept the 24th and at the Vermont Code Camp #4 on Sept the 22nd regarding Architecture problems and solutions linked to EF4.0, Async-await keywords and the Task Parallel Library.

This zip file includes both power points in french and english and the DemoApplication which is I REMIND YOU VERY DEMO-WARE and doesn't handle task level exception and context switching. 

ZipFile

Enjoy

 

Tuesday, July 17, 2012

Learning the hard way: Uninstalling .NET Framework 4.5RC


Uninstalling the .NET Framework 4.5RC can be a real mess, let me explain…

I had a perfectly functional VM on which I tried to install the 4.5RC version of the .NET framework to test out some of the new features of EF.  Since what I wanted to test didn’t work and since I THOUGHT 4.5 and 4 where side by side, I decided to go back to simply 4 and uninstall the 4.5RC from the VM.  Big mistake….  Now my Visual Studio would not work at all and kept saying “Unknown Error” when I started it…  After further investigation, I saw this post and as you can see in here http://msdn.microsoft.com/en-us/library/5a4x27ek(v=vs.110).aspx

when you uninstall the 4.5 framework it automatically uninstalls the 4.0 framework and ANYTHING related to it!  D’oh !!!

 

I re-installed the 4.0 framework and SP1 and now Visual Studio 2010 started working again.  But I wasn’t done fixing issues yet…  My application was using EF4 and ODP.NET and now, when I open up the EDMX I would see the following error:

error 175 the specified store provider cannot be found in the configuration or is not valid

 

I was quite annoyed by this so I decided to simply try to regenerate a new EDMX file from database… but I couldn’t !!!  In the drop down box where you choose your provider for the EF connection, Oracle ODP.NET had disappeared !!!!  *me throws holy water all around*  !!!   After much digging around, I found out that the MACHINE.CONFIG file had been modified by the uninstall process and that a very important line had been removed…

If you have this error and you use EF with a particular provider other than SQL Server, check out your machine.config file and see if this section contains the reference to your provider:

 

<system.data>

                <DbProviderFactories>

</DbProviderFactories>

</system.data>

 

Mine needed to look like this:

<system.data>

                <DbProviderFactories>

<add name="Oracle Data Provider for .NET" invariant="Oracle.DataAccess.Client" description="Oracle Data Provider for .NET" type="Oracle.DataAccess.Client.OracleClientFactory, Oracle.DataAccess, Version=4.112.0.3, Culture=neutral, PublicKeyToken=89b483f429c47342" />

 

</DbProviderFactories>

</system.data>

 

Restart your VS and your original EDMX will not complain about error 175 anymore…

But that wasn’t all, I ended up re-installing ODP.NET because my machine.config file was really messed up and missed many entries it previously had…  So a word of wisdom (which I didn’t follow, stupid me) is take a snapshot of your VMs before “trying out” 4.5RC and maybe uninstall it later or backup your PC….

Hope this saves you some time…

 

Monday, July 9, 2012

Multiple instances of Intellitrace.exe process


Not so long ago I was confronted with a very bizarre problem… I was using visual studio 2010 and whenever I opened up the Test Impact view I would suddenly see my pc perf go down drastically…  Investigating this problem, I found out that hundreds of “Intellitrace.exe” processes had been started on my system and I could not close them as they would re-start as soon as I would close one.  That was very weird.  So I knew it had something to do with the Test Impact but how can this feature and Intellitrace.exe going crazy be related?  After a bit of thinking I remembered that a teammate (Etienne Tremblay, ALM MVP) had told me once that he had seen this issue before just after installing a MOCKING FRAMEWORK that uses the .NET Profiler API…  Apparently there’s a conflict between the test impact features of Visual Studio and some mocking products using the .NET profiler API…  Maybe because VS 2010 also uses this feature for Test Impact purposes, I don’t know…

Anyways, here’s the fix…  Go to your VS 2010 and click the “Test” menu.  Then go to the “Edit Test Settings” and choose EACH test setting file applying the following actions (normally 2 files being “Local” and TraceAndTestImpact”:

-          Select the Data And Diagnostic option on the left

-          Make sure that the ASP.NET Client Proxy for Intellitrace and Test Impact option is NOT SELECTED

-          Make sure that the Test Impact option is NOT SELECTED

-          Save and close

 

Edit Test Settings

 

Problem solved…  For me having to choose between the “Test Impact” features and the “Mocking Framework” was a no brainer, bye bye test impact…  I did not investigate much on this subject but I feel there might be a way to have them both working by enabling one after the other in a precise sequence…  Feel free to leave a comment if you know how to make them both work at the same time!

 

Hope this helps someone out there !

 

 

 

Tuesday, April 17, 2012

DevTeach Vancouver approaching fast !


Just a friendly reminder for people in the Vancouver area that DevTeach Vancouver is just a few weeks away !  Registration is open and I can't help but promoting a full day of TFS 2010 workshop given by Etienne Tremblay and myself plus we will most likely add extra material to cover for TFS vNext...  The four added topics will be:

Moving from TFS 2010 to TFS vNext

The Storyboarding addin for PowerPoint

Intellitrace in a Production Environment

Exploratory Testing

 

Also I'll be presenting a 1h session on mocking and mocking frameworks during the main event.  We'll compare Isolator, Justmock and Moq....

See you in Vancouver !

Monday, April 16, 2012

Coded UI Test Builder Visual Cues Offset


Wow it's been a long time since I posted anything in here.....

Today I'll be very brief because the subject is quite easy to cover but can be quite puzzling when it happens to you...  These days at work I'm exploring Coded UI Test in VS2010, Microsoft Test Manager 2010 and Microsoft Test Runner 2010 which is cool because I've been digging aroung VS2010 testing tools on my own since a year now and also started focusing on VNext's testing tools...  So when you automate a test you will most likely end up having to use the Coded UI Test Builder shown here  

When inspecting controls on your app with the little "Target" tool, you could be confronted to your controls being highlighted "in the wrong place" on your screen.  Kind of like there would be some sort of offset between the control you are pointing to and the visual rectangle cue created by the tool to say "here's the control I think you're pointing to"... Looking at the picture here you can see it's pretty anoying to point at a control, see the tool inspecting the right object but highlighting it lower and to the right of where the control actually is...  I have no clue if this only happens in WPF but here's the solution or at least what worked for me...  In my case I was using the "Medium - 125%" display setting in the personalization of my Windows 7 laptop...  The Coded UI Test Builder only works well when your display is set to 100% (smallest in my case).  Change that option to 100% and everything will start being highlighted at the right place in the tool...  I do think that this was intentionnal and that the tool was built to work only when using 100%...  What a shame but now you know so stop reading and go back to work !

Happy automating :)

Sunday, September 25, 2011

A full day of Azure conferences...


On October the 15th, the Montreal .NET User Group will hold a special event... a full day of conferences and workshops on Azure !  The speakers for the special event will be our very own Guy Barrette, Azure MVP, Sébastien Warin also and Azure MVP and Cory Fowler who just happens to be yet another Azure MVP !  Ain't that just amazing to see how many of them Azure MVPs we managed to pack in the same room for you to learn from?  All this for one low price... 10$....  and you have to be a registered and paid for member of the .NET Montreal User Group...

 

Circle the date on your calendar, Saturday October 15th, from 9am to 16h30pm at the UQAM university, room R-M110.

 

http://www.dotnetmontreal.com/events/25706911/

 

Cheers !

Friday, September 23, 2011

Dev Teach Ottawa approching FAST !


The long awaited Dev Teach conference approches FAST and will be held in Ottawa on nov the 2nd to nov the 4th!

Very interesting material both in the main event and in pre-conferences with 2 friends of mine, Laurent Duveau and Mario Cardinal both giving a pre-conference workshop !  For my part, I'll be giving a talk on Mocking and Mocking Frameworks as I really think people need to be more aware of their power and the fact that nowadays, effective, responsive, scalable unit testing inevitably equals mocking frameworks...  There is a grand total of 48 sessions planned for the event: 12 sessions by ITProTeach for IT Professionals, 12 sessions by SQLTeach for DBAs and finally 24 sessions by DevTeach for developers.

If you are in the area, you should definitly try to attend the conference.... 

 

Register today !

 

 

 

Tuesday, September 13, 2011

Vote for my talk at Techdays Montreal 2011 !!!


Techdays Montreal approches fast and will be held at the Palais des Congrès on november the 29th and 30th of 2011.

This year, the event content will be decided by you, the attendees !

You can vote for your favorite content here on a track by track basis and voting ends this FRIDAY the 16th !!!!

http://bit.ly/tdcan2011vote

Note that you do not need to fill every page to cast in your vote....  BTW I think they activated IP checking to prevent people from casting multiple votes so vote from HOME, not WORK... and if you vote for me then vote from HOME, WORK, CELL, GF's house, school  etc   :)   Mouhahah !

Please check out the session I'll give on MOCKING and vote for me if that's something you would like to see at Techdays 2011 Montreal !!!

 

Thanks ! 

Tuesday, March 29, 2011

Bridging the Gap - En Français à Québec le 14 Mai 2011 !!!!


Our 13 sessions are now available in english on :

Nos 13 sessions sont maintenant disponibles en anglais sur :

CHANNEL 9 !!!!

 

Bonjour à tous, l'événement "Bridging the Gap Between Developers and Testers Using Visual Studio 2010" sera également présentées LIVE le samedi 14 Mai 2011 à Québec.  Toute une journée de contenu "Real Life" gratuite, présentée par Etienne Tremblay et moi même en personne et EN FRANÇAIS.

 

Pour plus d'informations ou pour vous inscrire, veuillez vous référer au site de DevTeach

Monday, February 14, 2011

Bridging The Gap Between Developers And Testers With VS 2010


On January 29th Etienne Tremblay and I presented infront of roughly 120 people in Ottawa a 7 hours "sketch" on how VS 2010 and TFS 2010 can help both devs and testers in their respective work.  The presentation focused on how a testers' work can positively influence a developers' work and vice versa.  The format was quite unusual as I said it's a "sketch" where Etienne and I "ignore" the audience and we do as if we were at work and the audience is sort of "spying" on us.  In all I'm quite pleased with the content we presented and the format sure was alot of fun to render and I think the audience liked it too...  The good news for you people reading this post is that it got RECORDED and it's now available for download in quick 25 to 35 minutes format on the dev teach web site:

 http://www.devteach.com/ALM-TFS2010-Bridgingthegap.aspx

 

There were 2 cameras, one filming us and one capturing the screen for our demos.  We switch from one to another in an intersting flow and Jean-René Roy made sure he kept all our goofs and didn't edit those funny "oups moments" where we screw-up in the scenario...  Mostly educative but hilarious at times !!!

I encourage you all to download and watch the 13 episodes...  Follow a day at work for a tester and a developper using VS 2010 and TFS 2010 to improve their chemistry ! 

Thanks to Jean-René Roy for all the work he's put into this event and to Microsoft and Pyxis for sponsoring the event.

 

 

Sunday, January 30, 2011

Urban Turtle is such an awesome product !


Mario Cardinal, the host of the Visual Studio Talk Show, is quite happy these days. He works with the Urban Turtle team and they received significant support from Microsoft. Brian Harry, who is the Product Unit Manager for Team Foundation Server, has published an outstanding blog post about Urban Turtle that says: "...awesome Scrum experience for TFS.” You can read Brian Harry's blog post at the following URL: http://urbanturtle.com/awesome.

Thursday, November 25, 2010

Speaker at Tech Days 2010 in Montreal


Thanks to everyone who took part in Tech Days 2010 either as a speaker, attendee or else.

It was a great event where I got to present 2 sessions.  For everyone who might want to material for both sessions, here it is!

My guess is that the audio material should be available soon, on the microsoft tech days site...

 

Cheers

 

Tuesday, September 21, 2010

Conference at Vermont's Code Camp


Well, it's been a long time since my last post and unfortunately it's another simple thread to share my material but I'll resume posting here and there in the next couple weeks...

 

Here's the   link     to my presentation and supporting material which was about Lambdas and Extension Methods using Visual Studio 2010...  The powerpoint is there and so is the small project I used to demo my subjects...  There's also the source code for the Umbrella project...

Cheers !

 

Monday, May 31, 2010

Conference on LinQ at Montreal's ETS


Today I gave a presentation at Montreal's "Ecole de Technologies Supérieure" and I said I would put my presentation and the material itself online in here....  The audience was exclusively composed of teachers from colleges around Montreal. 

There's the link to download the content :

http://cid-bdf9cf467011e705.skydrive.live.com/self.aspx/.Public/LinQ%20at%20Montreal%5E4s%20ETS/LinQ.zip

 

I hope all attendees learned more on LinQ than they knew before!

 

 

 

 

Copyright © Vincent Grondin