Quick Tip for Uploading Zip Files as Multiple Files to SharePoint server 2007 or WSS 3.0 from Vista

SharePoint allows suitably configured users to upload multiple files to document librations from the Upload menu item.

Unfortunately, on Windows Vista machines, any .ZIP files will not be shown for selection.

This relates to Vista’s ability to consider .ZIP files as folders into which a user can navigate within Windows Explorer.  This means that they don’t appear with the file list for the multiple upload.

There are some registry-change methods available to work around this but I find the quickest solution to be this:

  • Rename any .ZIP file to another extension prior to upload, e.g. .ZIP2
  • Select and upload the file in the multiple file upload selection
  • Use the Open with Windows Explorer option under the Document Library’s Action menu to browse to the uploaded file on SharePoint and rename it back to .ZIP.

This may not sound like a great solution and you may wonder why one would bother, especially for a single file.  Using the Multiple File method, allows the user to see a progress bar for the upload.  Additionally, the single file upload method may time out with a large single .ZIP file.

Not ideal, but it gets the job done!

Advertisements

All I want for Mix-mas this March at Microsoft Mix10

So the seasonal gift giving has now passed, but I’m hoping for a few good prezzies for Microsoft’s Mix conference.

  • Windows Mobile 7 rocking a .NET ‘Mobile’ (not compact) Framework programmable Silverlight 3+ interface, Xbox mobile games (like Zune games programmable with the free XNA Game Studio), Zune Interface, Media Center extender abilities, and a marketplace with no publishing gauntlet for music, games and apps, and real devices available by Oct 2010.  A full marketplace in Canada is a must!
  • ‘Visual Mobile 2010 Express Edition’ – I don’t need this since I’ll have VS 2010 Premium/Ultimate, but Microsoft needs to release a free mobile development tool (with Silverlight designer support presumably) that will launch 100,000 apps
  • Decent replacement for the Live Framework (which was withdrawn) including free Bing Maps API usage up to a decent ceiling
  • Consistent mobile and desktop Live Services and Framework experience
  • Live Mesh Release (with better-than-hopeless user documentation)
  • Better free and on-ramp deal pricing for the Windows Azure Platform
  • Microformat & Live Clipboard SDK for IE 9.  Ray Ozzie blogged and tinkered (including a subsequent SDK and runtime) about ‘Wiring the Web’ with a ‘Live Clipboard’ using microformats back in 2006.  Skip to the present day and go to this Microsoft Canada blog post this week promoting my Mix session proposals (thanks Joey) and look at the Mix-powered Microformat tool that appears at the top left ;-)  Accelerators for IE8 just didn’t do it.
  • Oh, and of course for one or more of my Mix sessions (see below) to be selected by the public through the voting that ends tonight! 🙂

Not too much to ask for right?

 

Looking to learn more about the Windows Azure Platform, Silverlight, Windows Touch or Windows Identify Foundation?

If you’d like to see these sessions in person at Microsoft’s Mix 2010 conference or the recordings that will likely be made available for free later on, please vote for the sessions before January 15th 2010, by going to the site, adding the 3 sessions to you ballot and submitting it

Quick Tip to Retain ASP.NET dynamic Recompile Changes During Azure Debugging

One of the major benefits of the Windows Azure SDK and Windows Azure Tools for Microsoft Visual Studio is the ability to operate an Azure Development Fabric and Azure Development Storage emulation on your local machine.  Pressing F5 in a Visual Studio Azure project deploys and runs your application in an environment emulating the real Windows Azure.  This is somewhat similar to the ASP.NET Development Server that starts up and somewhat emulates IIS (or other ASP.NET hosting environment) when you debug an ASP.NET application.

This is great, but can also create an efficiency bottleneck during development.

If you are debugging a regular ASP.NET application and you need to make changes, in many cases you can stay in debug mode;  you can edit an ASPX page or other assets (including CSS) and simply refresh the already running web browser instance to see you changes.  In the case of the ASPX page having changed, it is dynamically recompiled when you next access it.  This works because the ASP.NET Development Server is pointing at your development files.  This efficient cycle is lost when you start debugging with the Windows Development Fabric…

When you debug (or run) an Azure project in Visual Studio, your application is built into a package that is ‘deployed’ to the local Azure emulation.  The emulation therefore uses its own copy of the files.  Making changes to the file in Visual Studio while debugging, only updates the copies under Visual Studio’s control – they are neither repackaged nor redeployed.  The Azure Development Fabric has no idea that they’ve changed.  So, you have to stop debugging, re-launch, wait for the new package to build and deploy, and then get back to the same place in the application.

Here’s what likely amount to a satisfactory workaround before you are ready for the emulation stage:  create a mock for the Data Access Layer that deals with Windows Azure Storage and debug your project outside of the Azure Development emulation.  You lose role instance configuration, but you can go back to using the ASP.NET Development Server.  You may also lose the Azure diagnostic logging – but you can mock that too.

Note:  If you are using SQL Azure, for the most part you can use a regular local SQL Server in place.

I’m not suggesting you mock the interfaces to the Azure APIs directly.  Your application may well have a Data Access Layer which (when following best practices), will likely have an interface.  I suggest you create an object to mock this using the same interface or perhaps use one of the available mocking frameworks.

To facilitate the selection of the polymorphic DAL objects (real or mock) in one code-base you’ll likely want to make your application smart enough to know if it’s running in the Azure environment (Microsoft or local emulation) or not.  My previous post on the topic explains this idea.

You’ll need an interface that suits the operations of your DAL such as this example (where WallMessage is defined elsewhere)…

image

a mock object (such as the example shown below) and a real object (not shown) that both implement the interface…

image

and then calling code that first selects the mock or real object to use based on environment detection……

image

after which you go on to use properties and methods on the selected interface oblivious to the implementation being used.

This is just a basic example and as mentioned, there are some very good Mocking frameworks as well as Dependency Injection frameworks available that ease this kind of setup in large or complex solutions.

The code shown is from the sample Silverlight application I provide (including source code) in my Azure Deployment Guide, already used by 100s of people to successfully deploy their first Azure application.

I hope you found this tip useful 🙂 If so, and you’re reading this on January 15th 2010 then please vote for my Mix 2010 conference submissions today! :)  Thank you.

Looking to learn more about the Windows Azure Platform, Silverlight, Windows Touch or Windows Identify Foundation?

If you’d like to see these sessions in person at Microsoft’s Mix 2010 conference or the recordings that will likely be made available for free later on, please vote for the sessions before January 15th 2010, by going to the site, adding the 3 sessions to you ballot and submitting it

Quick Tip for Scaling a Silverlight Canvas On Browser Resizing

UPDATE: For the easy route, consider placing your canvas in a ViewBox control which is in the Control Toolkit for Silverlight 3 and is included in the Silverlight 4 runtime.

In December I produced an an easy-to-follow Azure Deployment Guide which has so far been successfully used by hundreds of people to deploy an application to Windows Azure.  It also came with a sample Silverlight application.

That application includes the capability to scale an inner canvas (while maintaining aspect ratio) in response to the outer grid and control being resized as a result of the browser window being resized by the user.

In the following screenshots you’ll notice that the header/footer text stays the same size but the green canvas area scales to fit.  You’ll also notice that it centres horizontally and aligns to the top.

image

image 

image

To achieve this we need to do a few things…

image

In the Silverlight UserControl’s XAML, make sure no Width and Height are set on the UserControl element (note that the d:DesignWidth/Height are there for design-time sizing only).

Note the name of “LayoutRoot” give to the top-most element.

 

image

Give the canvas a starting size which represents 100%.

Note the name “Wall” given to the canvas we want to scale.

Note the Scale and Translate transforms added to this canvas.

 

image

In the HTML page, the Silverlight control needs to be sized to 100% of the available width and height (and this needs to suitably apply all the way to the root of the HTML page).  You may do this with CSS styling or some other means.

 

image

In the Silverlight UserControl’s code-behind find, register for the resize event on the LayoutRoot object (which is a Grid in this case).

 

image

React to the resizing of the Silverlight control.

This code figures out whether there is more space to scale horizontally or vertically, and applies the lower of the two in both the X and Y direction (preserving aspect ratio) using the named transforms.

The calculations make use of ActualHeight and ActualWidth from the containing space.

The code also horizontally centres the canvas in the containing space.

I say ‘containing space’ in this case, because the Canvas to be scaled is in the middle of 3 rows and the single column in the parent Grid.

For the full code, check out the sample application with the Azure Deployment Guide.

I hope you found this tip useful 🙂 If so, and you’re reading this on January 15th 2010 then please vote for my Mix 2010 conference submissions today! :)  Thank you.

Looking to learn more about the Windows Azure Platform, Silverlight, Windows Touch or Windows Identify Foundation?

If you’d like to see these sessions in person at Microsoft’s Mix 2010 conference or the recordings that will likely be made available for free later on, please vote for the sessions before January 15th 2010, by going to the site, adding the 3 sessions to you ballot and submitting it.

Quick Tip for Detecting Azure Environment During Your Development Cycle

Given the Azure tools and portal for Visual Studio 2008, there are 4 likely modes of execution during your development cycle:

  1. Testing in Visual Studio (with no Azure environment)
  2. Testing in Visual Studio using the local Azure Development Fabric/Storage
  3. Staged on the Azure portal
  4. Deployed on the Azure portal

#1 mostly applies when you have an application that you are porting, or you are development components that may become part of the application.

At times you may find it useful to know if you are running inside or outside of the Azure environment (i.e. 1 vs. 2/3/4).

image

Providing you have included the appropriate assembly reference, you can use this API to detect your environment and take appropriate action while developing and testing your components at the stages above.

Looking to learn more about the Windows Azure Platform, Silverlight, Windows Touch or Windows Identify Foundation?

If you’d like to see these sessions in person at Microsoft’s Mix 2010 conference or the recordings that will likely be made available for free later on, please vote for the sessions before January 15th 2010, by going to the site, adding the 3 sessions to you ballot and submitting it

Visual Studio 2010 to Release on April 12 2010

Microsoft previously announced a push-back before the US holiday season, and the addition of a Release Candidate in February 2010.

“In order to ensure that we are able to receive and react to this feedback, we will also be moving the launch of Visual Studio 2010 and .NET 4 back a few weeks.”

Since the RC hasn’t happened yet and the “receive and react to” window is a fixed length of time, it makes me believe that Microsoft is now confident enough about its solution to the performance issues that it can announce a final date with at least the perception of a reaction to the added RC.

Just 2 days Left to Vote for Mix 2010 sessions on Azure, Silverlight, Windows Touch and WIF

Voting ends on Friday for sessions at Microsoft’s Mix 2010 conference.

I’ve submitted 3 session proposals – see the details – around Windows Touch, Azure & Silverlight which were all accepted into the voting list.  My session on Windows Identity Foundation has already been scheduled for the renowned high-level DevTeach 2010 conference at Microsoft’s Canadian HQ this March.

If you’d like to see my sessions in person at Mix or the recordings that will likely be made available for free then please vote for them.

You can find a list of all sessions available for voting  (a list that periodically shuffles its order), or go directly to my sessions here.  You can pick a total of 5 sessions to vote for.