Installing DotNetOpenAuth 3.4 from NuGet breaks debugging in IIS Express

During a coding session recently, I needed to use the DotNetOptnAuth project to perform some authentication to a vary of outside services. I know that this library is available on the nuget package systems so I added the reference via nuget in Visual Studio.

image

Now, assuming you are the default Visual Studio Development Server and you run your project right away you’ll have a false sense of security that your project is all set and ready to go, like the following. All looks good right?

image

If you dig a little deeper, and set your project to use IIS express, like the following (If you don’t have IIS Express you can download it via the Web Platform Installer, or by downloading Web Matrix, which will get you IIS Express by default).

image

then try to debug your project you all of a sudden see an error about stating that you have a duplicate section defined in your web.config file.

image

So what’s the problem? It turns out that when we added the nuget package for DotNetOpenAuth, the package also adds a line to our project web.config like the following.

image

However, if you take a quick look at the machine.config for the .NET 4 framework located at the following location C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config you’ll see that there is a section alreay defined in the machine.config like the following. This is what is causing the conflict here.

image

So what’s the resolution? It’s pretty simple actually, you can either remove of comment out the <section> line in the project web.config and everything should be back to normal.

Side Note: 
There is a beta build of DotNetOpenAuth 4.0 that might address this issue, but I haven’t downloaded it yet to verify. If you have feel free to leave me a comment below.

Cool video from channel 9( and Anders Hejlsberg)

Cool video from channel 9( and Anders Hejlsberg).

Another good video introduction to Reactive Extensions

Here is another good introduction video to Reactive extensions for .NET by Eric Meijer, all in 15 minutes Smile

Good video on Reactive Extension for .NET

Recently I have been working on a Windows Phone app and starting to look into the Reactive extension for .NET. NHere is a good over video from DevCamp 2010 by Bart de Smet.

Windows Phone 7 Accelerometer QuickApp

Saw this video up on the Channel 9 site and it’s a good introduction using the accelerometer in silverlight on windows phone 7.

Some good javascript videos by Douglas Crockford (Old videos but still good)

Recently I was searching around for some video’s on JQuery, and ran across these video by Douglas Crockford (The same guy that wrote the JSON spec Smile). A good primer on javascript and has some excellent info in them, even for the experienced javascript developer.

 

The JavaScript Programming Language 1/4
The JavaScript Programming Language 2/4
The JavaScript Programming Language 3/4
The JavaScript Programming Language 4/4

WorkFlow Studio 2.0 Development and Cached Activities (A Utility to clear them up)

Recently I was playing around with Citrix WorkFlow Studio 2.0. Specifically I was writing some custom activities to help with data connections, etc. Before I get into the tech contents, lets provide a little background on WorkFlow studio and how we can extend it with our own code. If you want to see an brief unabridged of WorkFlow studio click the link below. You can also check out the Citrix site here

Click here to download the Workflow Cache Cleanup Utility

WorkFlow Studio Overview (Click me to expand the overview)

The interesting thing about WorkFlow Studio (because its built on Windows Workflow Foundation) is that you can write your own activities and make them available for use in other activities and allow other users of WorkFlow Studio to use them as well.

So, developing your own custom activities is certainly an iterative process, write some prototype code, deploy it to the GAC (Global Assembly Cache), test the results. Rinse and repeat :) .

While doing this, I noticed a interesting thing happening. I would deploy my test activity to the GAC, then I would add it to workflow studio. All is peachy :) . Then i would remove it from the GAC, but it would still show up in workflow studio. This was puzzling me. WorkFlow Studio must be caching the information somewhere!

I dug around a little, but couldnt really pin point where this was happening, so I figured, go right to the source :) , so I shot an email over to Pete Shulz, Product Manager for WorkFlow Studio (you can follow him on twitter at http://twitter.com/schulzpm)to see if caching was indeed happening. Well, Pete did inform me that WorkFlow Studio does indeed cache previously added components. He also pointed me to this articles up on the Citrix Developer Network, which explains it in more detail.

(http://community.citrix.com/display/wf/Tips,+Tricks,+and+Best+Practices)

I thought this was good, but I didn’t really want to dig around in files every time I wanted to clean up my orphaned activities, so, like Tim Allen, I wanted more power!! What I wanted was a quick little utility that i could run that would list the cached activities and then allow me to selectively delete the ones I wanted to. So, I had some extra time last night so figured I would through something small together. that’s what I build. You can download the app here. Its not a pretty app, but it does get the job done. NOTE: Before we modify anything in the config file we always make a backup of it. Those backups are located in the “C:UsersJohnAppDataLocalCitrixWorkflow StudioWorkflowStudio2.0.0.0’ directory and will have a “Backup” prefix to the file. Like the following screen shot.

image

Initial loaded screen. It lists your currently cached activities. Here we show you the name, assembly name, weather or not it is shown in the toolbox, and what the toolbox path is (this is where you can find the activity in the activity folder structure)

image

Once the activities are loaded, you can them multi-select activities and right click, from the popup menu, you can then choose to delete the selected from the cache.

image

So that’s it for this article. You can download the app from here, but remember, I provide this only as a utility, because I use it during my development process. Please use this tool at your own discretion.

As always, you can contact me via this blog, or ping me on my twitter account (http://www.twitter.com/johnmcbride)

AJAX Minifier and a tool to view the output

Download the application here

Recently the the Microsoft AJAX team released Ajax Preview 6 up on codeplex (Check it out here). With this release they also released an Ajax Minifier tool that will allow you to crunch or minify JS files. There are several ways to use the minifier tool, you can incorporate in into your build process using msbuild, you could run command line tool manually and create an output file, or you can use the minifier dll that gets distributed with the tool in your own applications. It is this third option that sparked my interest so I thought I would whip an application that allows you to load Javascript into an editor and then “crunch” it with the Ajax minifier object and visually see the output. Below is a screen shot of the final output. (I am adding a settings option so you can control how the minifier works)

 

image

If you just want to grab the zip fie that has the exe in it to run, you can grab it from here.

The first thing we will need to do is grab and install the Ajax Minifier from here. Once installed you will find the ajaxmin.dll file in the install location, like the following. It is that file that contains all the “crunching” code and the file you will need to reference in your project.

image

Once you have referenced the ajaxmin.dll file in your solution you will be able to “crunch” some javascript. In order to “crunch” the javascript you will need to make a call like the following.

Code Snippet
  1.                 string Js = @"function ()
  2. {
  3.     //these are some javascript comments
  4.     var testVar = 'this is some alert text';
  5.     alert('Hey What are you doing!!!!, Crunch this stuff…..');
  6. }";
  7.                 Microsoft.Ajax.Utilities.ScriptCruncher sc = new Microsoft.Ajax.Utilities.ScriptCruncher();
  8.                 string CrunchedJS = sc.Crunch(Js);

 

I also want to give credit to the #develop guys over at ic#code for putting out a excellent open source IDE for .NET development. I am using the #develop’s  code editor control in this project to obtain the syntax highlighting, etc. Great work guys!!

you can check them out over at http://www.icsharpcode.net/OpenSource/SD/

 

That’s it for now and as always if you have any comments or questions you can comment here at the blog or catch me on twitter at http://twitter.com/johnmcbride

iPhone and XenServer Managment, There is an app for THAT!, and it’s called Xeni

A friend of mine and I (Check out Ritch’s twitter feed here and his blog here) were talking a while back about the iPhone and the adoption into the business environment. Yes there are apps out there for business, but very few and not very many which people would use everyday in business. Now, coming from and IT/Dev background we also noticed a lack of enterprise management utilities that were native iPhone apps.

That lead to a few idea’s for iPhone projects, some of them I can’t talk about right now, but stay tuned I’ll blog about them in the near future. Just think Healthcare, iPhone :) .

The first of these projects is an app we are calling Xeni (Pronounced Xen-eeee) and is one of the apps that will give enterprise admin’s and alternative application to help perform their daily job functions. Can you guess what it is? :)

Well, this iPhone application is all about managing your XenServer environment, from the XenServers to the Virtual Machines to the user sessions and beyond, all from a native application on the iPhone. We are not releasing this application yet to the appstore as we are still in the testing phase but wanted to let the community know what is coming down preverbal pike :) and show off some screenshots.

In developing this app we did not really want to bake in a lot of services into the app itself, so we choose to write a few other SOA type services. One of these services, called WCFforCitrix Services, we wrote specifically for allowing access to Citrix based products from the service layer. Since we always like to give back to the community, we are now opening sourcing the WCFforCitrix project under the MSPL license and hosting it up on codeplex. We are in the process of uploading the source files in the next few days so be sure to keep monitoring the WCFforCitrixServices project here for more information. We are adding more features to this project daily so keep an eye on it.

So without further delay, lets take a look at some of the application screen shots here.

Xeni for iPhone
Main Home Screen Loading Screen (Splash)
image XeniImage2
Obviously this is the home screen when the application gets installed on either your iPhone/iPod touch. Splash Screen, that initiates communication to the backend systems to finding out your XenServer infrastructure.
Xen Servers Listing Screen Virtual Machines Listing (Based on XenServer)
XeniImage3 XeniImage4
After the application loads it will display any xen servers configured in your environment. Allowing you to drill down into properties of each server After selecting the XenServer, you can then see which VM are running on that selected server. Allowing you to see the properties of each VM by drilling into it.
Virtual Machine Properties Screen Actions Screen (Virtual Machine)
XeniImage5 XeniImage7-updatedactionscreen
After selecting the VM you can then see more Virtual machine specific properties as well as perform specific actions on the VM, Access the VNC console, check out alerts, etc. A full functioning management utility You can also perform specific actions on the VM such as, starting it, pausing it, moving it to another server, or deleting it entirely. Careful with that one!! :)

I haven’t posted all the screen shots, but I will be putting up a few more blog posts of the features of the app including more screen shots of the addition items. But hopefully, given the app store approval process, when testing is done the Xeni app should hit your iPhone or iPod soon.

As always, feel free to contact me via my twitter feed here or from the comments section (or you can email me here). Hope you guys like it :)

Virtual Box 3 and Windows 7 (Making it work!)

On and off for the last few weeks I have been trying to get VirtualBox 3.0.2 installed on my Windows 7 RC device with no real success :( . During every install I ended up getting the dreaded “Setup wizard end prematurely” and subsequently VirtualBox wouldn’t get installed and it would be back to the drawing board.

Well, after some troubleshooting and some customizing of the MSI file I have finally got VirtualBox installed and running :) but wanted to put this post together for those that are running into the same issue.

So, let’s get to it :)

First, let me define what my system is
1) Windows 7 Ultimate RC 64bit.
2) No previous version of Virtual Box installed on this device.

What your going to need:
1) Orca MSI Editor
2) Windows Driver Kit (MSDN Downloads)

Running the downloaded install of VirtualBox you will get the following installation error. The dreaded “Setup wizard ended prematurely”! That’s never good!

image

After looking at the log file, you will notice a curious error
”DIFXAPP: ERROR – The operating system you are running on is not supported. Only Windows 2000, Windows XP, Windows Server 2003 and Windows “

After, looking at the above message it appears that DIFXAPP is having a problem some where, my first theory is that the VirtualBox installer is using an older version of the DIFXAPP dll.
So, armed with the above theory, lets update the MSI installer with the updated versions of DIFXAPP dlls.

The first thing we need to do, is to download the Windows Driver Kit (Specifically I downloaded the driver kit for Windows 7). This download contains the updated DIFXAPP file that we are going to need to replace the ones in the MSI. Right now it looks like this download is on the MSDN Subscribers site so you will probably need a MSDN Subscription in order to download it. You can access the site here.

After you have downloaded and installed the Windows Driver Kit we are going to need to update the MSI with these new updated files. I know what your thinking, We didn’t get an MSI when we downloaded, we got an EXE. No problem, let me explain. When we run the virtualbox insaller, the EXE extracts and MSI called VirtualBox-3.0.2-r49928-MultiArch_amd64.msi, as see in the following image.

Now, where exactly is this file? The MSI file will get extracted to the users temp appdata folder. On Windows 7 it will be located in the following location
C:Users[YourUsername]AppDataLocalTempVirtualBox

image

So, now that we have all the necessary files, we need to put it all together and update the MSI file with the updated DIFXAPP dlls. The first thing we are going to want to do is to open up the above MSI file in the Microsoft ORCA MSI Editor. Once you do you will see the following. Note the Binary item in the left pane in selected and in the right pane you can see the DIFX*.dll files that we are going to need to replace.

image

The next thing we need to do is to delete the DIFX*.dll items from the MSI. You can do this by right clicking on the DIFxApp.dll and selecting “Drop Row” from the menu that pops up. You will need to do this for the DIFxAppA.dll as well. Like the following

image

image

The next thing is is to re-add the updated DIFX files we got from the updated Windows Driver Kit to the MSI file. We can do this by right clicking and selecting “Add Row”

image

Now we need to select the updated DIFxApp.dll we extracted from the Windows Driver Kit we downloaded earlier. In my installation it is located here
C:WinDDK7100.0.0redistDIFxDIFxAppWixLibamd64

Make sure the Name Attribute is the exact name as the DLL name. For example, the name for the DIFxApp.dll you be DIFxApp.dll

You will need to do this once for the DIFxApp.dll and once for the DIFxAppA.dll files. Like the following screen shots.

image

href="http://www.sharepoint-stuff.com/wp-content/uploads/2009/07/image10.png">image

Once that is complete, you will need to save the MSI file from ORCA. Make sure you just do a File->Save. If you do a SaveAs the MSI will lose information and it will not work.

Once you complete the save you will now be able to run the MSI and get VirtualBox installed.

I am working on a quick video to show the results and should have it up soon. If you have any questions/comments feel free to comment and ping my on twitter twitter.com/johnmcbride