Msbuild: Adding an assembly to the GAC remotely

I had some fun in converting my build/deploy scripts. These scripts are made to build and deploy a BizTalk project with one click on your local development machine to avoid to much clicking. The scripts are making use of MSBuild.

On my current project, the development BizTalk Servers are remote machines, the scripts were still working fine, except adding an assembly to the GAC on the remote machine caused some problems.

The first step to add an assembly is finding the right MSBuild task to do this. I’m using the MSBuild extension pack, this extension pack contains a GAC task (makes use of Gacutil.exe). The task is used as follows:

 <MSBuild.ExtensionPack.Framework.Gac TaskAction=AddAssembly AssemblyPath=$(asseblyPath) RemoteAssemblyPath=$(remoteAssemblyPath) MachineName=$(Server) Force=true /> 

As taskaction, I choose ‘AddAssembly’, specify a local and remote assembly path and a machine name (the remote server). If your user account does not have the necessary privileges to add the assembly to the remote GAC, you can specify a remote user/password combination.

Although this looks ok, this is not enough…

The remote machine is a server, without the .NET 2.0 SDK installed. The gacutil.exe tool is shipped with the .NET 2.0 SDK. We could install the .NET 2.0 SDK but it is enough to deploy gacutil.exe on the remote server.

This still did not work…

One final thing should be done! The GAC MSBuild task does not know where to find gacutil.exe. To fix this, we must add the path to gacutil.exe to the PATH environment variable.

If these three steps are done, we can GAC our assembly on the remote machine….

 

Peter Borremans

WF 4 Feature request: Group activity into Sequence

WF 4 Feature request: Group activity into Sequence

The Logitech iFeel optical mouse uses a red LE...

Image via Wikipedia

One of the things developers often have to do is replace a single activity with multiple ones. This requires replacing the original activity with a Sequence and then adding the original activity to the sequence. When developing UI in Blend the same kind of operation is often required to wrap an element inside of a StackPanel, Border or something similar. In Blend this is very easy to do as there is a context menu for just this action. So all that is needed is right click and wrap something in the container of choice.

I would like to see the same functionality in the workflow designer where the user can select an activity and wrap it in a Sequence, TryCatch, TransactionScope and other relevant activities. I would also like to see the opposite where a developer can remove a wrapping Sequence is there are no other child activities.

 

 

Do you think this would be a useful feature to have? Then please go here and vote for it!

 

Enjoy!

www.TheProblemSolver.nl
Wiki.WindowsWorkflowFoundation.eu

March 21st Links: ASP.NET, ASP.NET MVC, AJAX, Visual Studio, Silverlight

Here is the latest in my link-listing series.

If you haven’t already, check out this month’s "Find a Hoster” page on the www.asp.net website to learn about great (and very inexpensive) ASP.NET hosting offers. 

[In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu]

ASP.NET

  • URL Routing in ASP.NET 4: Scott Mitchell has a nice article that talks about the new URL routing features coming to Web Forms applications with ASP.NET 4.  Also check out my previous blog post on this topic.

  • Control of Web Control ClientID Values in ASP.NET 4: Scott Mitchell has a nice article that describes how it is now easy to control the client “id” value emitted by server controls with ASP.NET 4.

  • Web Deployment Made Awesome: Very nice MIX10 talk by Scott Hanselman on the new web deployment features coming with VS 2010, MSDeploy, and .NET 4.  Makes deploying web applications much, much easier.

  • ASP.NET 4’s Browser Capabilities Support: Nice blog post by Stephen Walther that talks about the new browser definition capabilities support coming with ASP.NET 4.

  • Integrating Twitter into an ASP.NET Website: Nice article by Scott Mitchell that demonstrates how to call and integrate Twitter from within your ASP.NET applications.

  • Improving CSS with .LESS: Nice article by Scott Mitchell that describes how to optimize CSS using .LESS – a free, open source library.

ASP.NET MVC

  • Upgrading ASP.NET MVC 1 applications to ASP.NET MVC 2: Eilon Lipton from the ASP.NET team has a nice post that describes how to easily upgrade your ASP.NET MVC 1 applications to ASP.NET MVC 2.  He has an automated tool that makes this easy. Note that automated MVC upgrade support is also built-into VS 2010.  Use the tool in this blog post for updating existing MVC projects using VS 2008.

  • Advanced ASP.NET MVC 2: Nice video talk by Brad Wilson of the ASP.NET MVC team.  In it he describes some of the more advanced features in ASP.NET MVC 2 and how to maximize your productivity with them.

  • Dynamic Select Lists with ASP.NET MVC and jQuery: Michael Ceranski has a nice blog post that describes how to dynamically populate dropdownlists on the client using AJAX.

AJAX

  • Microsoft AJAX Minifier: We recently shipped an updated minifier utility that allows you to shrink/minify both JavaScript and CSS files – which can improve the performance of your web applications.  You can run this either manually as a command-line tool or now automatically integrate it using a Visual Studio build task.  You can download it for free here.

Visual Studio

  • Dependency Graphics: Jason Zander (who runs the VS team) has a nice blog post that covers the new dependency graph support within VS 2010.  This makes it easier to visualize the dependencies within your application.  Also check out this video here.

  • Layer Validation: Jason Zander has a nice blog post that talks about the new layer validation features in VS 2010.  This enables you to enforce cleaner layering within your projects and solutions. 

  • VS 2010 Profiler Blog: The VS 2010 Profiler Team has their own blog and on it you can find a bunch of nice posts from the last few months that talk about a lot of the new features coming with VS 2010’s Profiler support.  Some really nice features coming.

Silverlight

  • Silverlight 4 Training Course: Nice free set of training courses from Microsoft that can help bring you up to speed on all of the new Silverlight 4 features and how to build applications with them.  Updated and current with the recently released Silverlight 4 RC build and tools.

  • Path Based Layout – Part 1 and Part 2: Christian Schormann has a nice blog post about a really cool new feature in Expression Blend 4 and Silverlight 4 called Path Layout. Also check out Andy Beaulieu’s blog post on this.

Hope this helps,

Scott

Getting time from datetime in TSQL

As everyone already knows, to extract the time from a datetime (pre SQL 2008), you have to use the convert function

HOWEVER: beware of using the smalldatetime type, as it trucates the seconds from the value convert returns

Run the following code:

declare @thissmalldatetime smalldatetime,@thisdatetime datetime
select @thissmalldatetime=getdate(),@thisdatetime=getdate()
select convert(nvarchar(8),@thissmalldatetime,14) as [Small Date Time],convert(nvarchar(8),@thisdatetime,14) as [Date Time]
waitfor delay '00:00:01'
select @thissmalldatetime=getdate(),@thisdatetime=getdate()
select convert(nvarchar(8),@thissmalldatetime,14) as [Small Date Time],convert(nvarchar(8),@thisdatetime,14) as [Date Time]

Small Date Time Date Time
--------------- ---------
13:13:00        13:12:40

(1 row(s) affected)

Small Date Time Date Time
--------------- ---------
13:13:00        13:12:41

(1 row(s) affected)

Pluralsight at DevWeek 2010

Pluralsight at DevWeek 2010

Another great year at DevWeek 2010 – can’t believe the show is already coming to a close. DevWeek is always a great event, organized by Nick Payne and team of Bearpark Publishing. Pluralsight had quite the gang out this year including Fritz Onion, Keith Brown, Jon Fancey, Ian Griffiths, Scott Deadrick, Meagon Marshall, and of course me.

DevWeek-Banner Pluralsight-Crew-Booth

Our technical team delivered a long list of breakout sessions on pre/post-conference workshops, which you can read about on Meagon’s blog. I personally did a workshop plus 6 breakout sessions on primarily Azure, Cloud Computing, and REST. I really enjoyed my sessions this year, mostly because the attendees were so engaged and full of questions, especially the ones on REST yesterday. My favorite talk this year was the one on REST + XHTML + MVC.

Demos: for those of you who attended my sessions, you can download my DevWeek 2010 demos.

IMG_1787 Aaron-session-1

On Monday night Nick hosted a speaker’s dinner at a very peculiar and popular London restaurant known for their unique and creative fare (can’t remember the name). Check out the starter bone marrow on toast and look at Jeff Richter ready to dig into his main course. 😉

IMG_1776 IMG_1774 IMG_1783

It was a very unique and entertaining experience to say the least – thanks Nick!  We also enjoyed the London fare you might expect (Indian and Thai) over some very nice Pluralsight dinners.

Pluralsight-Dinner-Indian  IMG_1793

We received a lot of great feedback during the event from attendees all over the UK using Pluralsight On-Demand! Every DevWeek attendee received a free 1-week pass to Pluralsight On-Demand! (look for the white plastic card in your attendee bag) and those who attended my Azure precon received another special gift – you know what to do – make sure you email Meagon if you didn’t catch her at the event.

Our secret? Check out Fritz here playing the siren song of Pluralsight On-Demand! on classical guitar once you hear the tunes, you just can’t help yourself, so beware.

Fritz-Playing-Booth

More photos?  Check out the Pluralsight .NET Training Facebook album for DevWeek 2010. Thanks again to Nick, the crew, and all the attendees for another great year!