Posts
243
Comments
24
Trackbacks
13
Thursday, October 22, 2009
Making a Windows 7 bootable USB…

This get’s even easier.  The Microsoft store has released a utility that will, from an ISO (eg. one you get from the Microsoft Store) create a bootable USB flash drive.

The direct link is here to the description page

http://store.microsoft.com/Help/ISO-Tool

posted @ Thursday, October 22, 2009 9:45 AM | Feedback (0)
Saturday, October 03, 2009
Visual Web Part Designer in Visual Studio 2010

In the October edition of MSDN Magazine, there’s a great article that does a quick rundown of building a component that can be surfaced as a Web Part via the Gallery and placed in Web Part zones on pages.

The article by Steve Fox is here: Steve Fox - Visual Studio 2010 Tools for SharePoint Development – MSDN Magazine October 2009

There’s a couple very important aspect that might not be 100% clear from the title – 1st, you’re really visually designing a User Control (ASCX).  So, this is really just a “visual user control designer and web part cookbook combination deployment helper”…

And 2nd– this all works today, you just don’t get the magical build of the CAML based manifests, feature.xml, DDF, etc. to rapidly get into the “code –> build –> debug –> test –> code” cycles needed to increase the velocity of development.  Well, actually you can – with a couple of 3rd party tools.

I’m not saying this isn’t a good thing – having VS2010 provide this capability.  In fact, what they are providing is industrialization of development patterns into a model that provided directly in the VS 2010 environment that was “cobbled” together either through the VseWss extensions or tools such as WSP Builder.

User Controls

Now, why are User Controls potentially a concern.  In one word “versioning”.  Since, even in the example, most user controls are deployed to the farm into the “12” or “Root” hive of SharePoint – they are Farm based artifacts – in that you get 1 and only 1 of these “ASCX” files to be reused wherever they are statically referenced.

That doesn’t give you true “Side-by-Side” (SxS) installation – which we can get with an Assembly that packages our Server control or Web Part Server control into a strong named that we can explicitly reference at runtime.

That means if you have 2 Web Apps, Sites, whatever, that want to use distinct versions, you have to provide a way to have basically 2 complete “sets” of all these artifacts and using the way the example code was presented, you’d have to come up with a way to put a version name in the “filename”.

So, how would you change the ASCX portion of the component for site #2 and redeploy?  Well, one way is to change the following – which is in your truly compiled class that probably made it into the GAC:  You can change a couple of things – 1st, the name of the ASCX file:

private const string _ascxPath =
@"~/CONTROLTEMPLATES/SampleWebPartProject/ProductInfo/" +
@"ProductInfoUserControl.ascx";

If you change the name of the ASCX file, well, that didn’t buy you much.  Because, all instances across the Farm will still use this.

Option 1

Another way is to change the prefix of the path “~/CONTROLTEMPLATES/” – to something unique.  For that one, in the past I’ve simply use IIS virtual path mapping to a specific feature folder that contains the version name in the folder.  So, for example:

Site1: “~/_MYCONTROLS”  is mapped to   “..\12\TEMPLATE\FEATURE\ControlsV1”

Site2: “~/_MYCONTROLS”  is mapped to   “..\12\TEMPLATE\FEATURE\ControlsV2”

The only difference being that it’s physically mapped to a different location (physical directory) – so at runtime it picks up the mapped version through IIS virtual directory magic. 

This can be automated, creation of process through AppCmd as follows: (I've left out the full 12\14 hive path).

AppCmd.exe ADD vdir /app.name:"LitwareInc/" /path:/_MYCONTROLS /physicalPath:c:\...\FEATURE\ControlsV2

So, what’ve got now is a single assembly, the true “web part server control” instantiating the version you really need. All for just a little bit more on the configuration side.

Option 2

An option that I’d like the template to automatically provide is to externalize the control name (ASCX) file to use at Web Part configuration time through the use of a property on the web part.  This could then be managed through the Web Part property editors that we get for free in SharePoint.

This way at Page or Web Part configuration time, you either explicitly set this property or you provide some default in the code.  So, a property like the following would surface in the property editor allowing an “administrator”. 

So, this is what I’ve done in the past that works:  In the web part define a configurable property as follows:

[WebBrowsable]
[WebDisplayName("Control File Name")]
[WebDescription("Name of the ASCX file in the feature folder")]
[Category("Custom")]
[Personalizable(PersonalizationScope.Shared)]
public string ControlFileName {
    get;
    set;
}

Then change the code in the Web Part class to the following (in fact, this is where you can now have a “universal” User Control loader and just one way to wrap these User Controls from a single GAC deployed Web Part shell

protected override void CreateChildControls()
{
string ctrlPath= @"~/_MYCONTROLS/" + this.ControlFileName;  //maybe validate this - er, does it end in ASCX?
Control control = this.Page.LoadControl(ctrlPath);
Controls.Add(control);
base.CreateChildControls();
}
posted @ Saturday, October 03, 2009 5:26 AM | Feedback (0)
Thursday, August 13, 2009
Connecting to Verizon Wireless Broadband

For some reason all of a sudden I started getting PPP errors during connection on VZW broadband on my Mobile phone.

So, I had to re-initialize the connection on the phone.  This also works when tethering the phone and you don’t have to use the VZW software

• Device: Smartphone wireless USB modem

• Connection Name: [[whatever name you want]]

• Number To Dial: #777

• Connection Availability: Anyone's Use

• Username: [[your phone #]]@vzw3g.com. Example: 9175551234@vzw3g.com

• Password: vzw

posted @ Thursday, August 13, 2009 6:11 PM | Feedback (0)
Thursday, May 28, 2009
MSDN Library – Low Bandwidth Mode…

If you’re needing access to MSDN library from a 3g tethered, or low bandwidth at a location, MSDN Library is now published in a mode that lowers the payload…

http://msdn.microsoft.com/en-us/library/default(loband).aspx

Much more detail on Scott Hanselman’s blog on the HOW…

http://www.hanselman.com/blog/LowBandwidthViewAndOtherHiddenAndFutureFeaturesOfMSDN.aspx

posted @ Thursday, May 28, 2009 5:17 PM | Feedback (0)
Friday, May 22, 2009
This version of the enterprise library cannot be installed side by side with version 4.0 on x64
When upgrading to Enterprise Library 4.1 on an x64 machine, even though you’ve run the 4.0 uninstaller, and even removed the registry key, you’ll still end up with an installer complaining that you can’t do side-by-side install.  The issue is the key is actually under the Wow node for x86 compatability – just remove this key…
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Enterprise Library v4
posted @ Friday, May 22, 2009 12:55 PM | Feedback (0)
Tuesday, May 05, 2009
Building a Mini URL Service – Part 2 – The Algorithm

Part 1 – Part 2

The first order of business is what URL shortening approach should be used to take some very long URL, which in IE7 is limited to 2,083 characters (KB208427) and provide a nice compact link.

The first part of the link (protocol + server + port) is generally controlled by what domain name you can get – for me, my little demo is http://MyMiniUrl.net. The rest of the URL – the path is something in your control.

Doing a search I came across a few approaches but settled on a Base 62 approach that uses a sequence generation maintained in the persistence tier. The idea is to generate a unique sequential number, then convert that numeric to a Base 62 representation. For the sequence generation, I just relied on the DB layer (MySql or MS SQL) to generate this from an identity column.

Once that identity value is generated, it gets run through a Base 62 conversion to a string representation. That string along with the identity (from the DB), the full Long URL, and a cryptographic hash of the Long URL is stored in the DB. The basic DB table schema is as follows (for MySQL):

Column

Type

Description

urlId

Bigint(20)

Identity column

miniUrl

Char(12)

Shortened “path” of the URL

fullUrlHash

Char(32)

Crypto hash of Full URL using MD5

fullUrl

Varchar(4096)

Full URL provided

The indices are as follows:

  • Primary – index on urlID
  • fullUrlHash – Unique index
  • miniUrl – I left this as “not unique” given my persistence pattern starts off with this value as null.

So, when the URL service is asked to create a short URL, it first checks to see if the URL was already generated. To do that the UrlService uses the basic pattern:

  1. Checks the URL pattern to a matching regular expression (in the config file)
  2. Generates a MD5 hash of the full URL
  3. Checks to see if the hash already exists doing a SQL lookup on the hashed value of the full URL
    1. If exists, just return the existing shortened URL
    2. If doesn’t exist
      1. Insert new Long URL, Hash of URL
      2. Get new identity key
      3. Convert new identity key to Base 62
      4. Return short URL using Base 62 representation

Now, for the Base 62 algorithm, I looked around at a few approaches, and Chris had a good post on various approaches as well – Friendly Unique Id generation.

Starting with his code, I also found another approach located here, then finalized on the following:

        static int baseNum = 62;

        private static readonly String baseDigits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

        public static string Base62ToString(long fromValue)

        {

            string toValue = fromValue == 0 ? "0" : "";

            int mod = 0;

 

            while (fromValue != 0)

            {

                mod = (int)(fromValue % baseNum); //should be safe

                toValue = baseDigits.Substring(mod, 1) + toValue;

                fromValue = fromValue / baseNum;

            }

 

            return toValue;

        }

The basic approach is to loop through the source value, grab the remainder, convert that remainder to Base 62 and append it to a string return value, until there’s nothing left.

So, in terms of “string” vs. StringBuilder performance, I also tried using StringBuilder in place of string concatenation, but performance, in a loop of a billion iterations was far better (about 60%) just with simple string concatenation. Now, I’m not too concerned with garbage collection at this point, I just wanted something quick and efficient – and in the end correct.

posted @ Tuesday, May 05, 2009 8:22 AM | Feedback (0)
Monday, May 04, 2009
Building a Mini URL Service – Part 1

This set of posts is about a "Mini URL" service that I created initially to help provide a means to automate shortening of URL's for sending in emails to users in SharePoint. If you've used SharePoint and at times you need to send a link to a List or Document item one way is to "right-click" the item (whether it's a folder, list item, or document) then if it's IE choose "Copy Shortcut". You can then just past that into an email and send over to your recipient.

Recently, I also noticed that even the White House Tweets (http://twitter.com/whitehouse ) are using another well known URL shortening service. A quick look around and you'll see that there are quite a few out there now.

So, I stripped what I built into very basic ASP.NET Web Site and created a service that is now hosted at GoDaddy at http://MyMiniUrl.net. This intended as a pure demo project and the full SharePoint integration won't initially be made available until I work out some minor issues – mostly related to "packaging". But for now, I wanted to just document some of the initial steps, challenges, and work-around that I encountered building this along with some of the decisions (trade-offs) I made along the way.

The initial technical goals of the service are as follows:

  1. Provide a very basic redirection service for short URL – i.e. http://myminiurl.net/B
  2. Hosted on IIS7
  3. Hosted on GoDaddy with their form of "Application/Domain" mapping – you'll see a minor challenge here later related to how Request.ApplicationPath, the tilde (“~”) don’t work as expected…
  4. Provide Persistence tier independence through Provider model <system.data/DbProviderFactories>
    1. MS SQL
    2. MySQL
    3. Future (SQL Lite)
  5. Pluggable HttpModule for incorporating into existing web sites

The SharePoint integration aspect, not yet provided here, is implemented as an ECB (Edit Control Block) menu option that allows immediate automated generation (or lookup if the URL has been shortened already) then presentation of a quick Application page that allows the user to specify an email or pick from People Picker to send out.

MyMiniUrlEcb

Again, I've not published that part of this yet until I address a few issues.

 

del.icio.us Tags: ,
posted @ Monday, May 04, 2009 11:15 AM | Feedback (0)
Making a Win7 Bootable USB device.

I have an old Toshiba that has no optical drive.  To install Win7, I needed a bootable USB stick.  Here are the basic steps

0. Download Win7 http://www.microsoft.com/windows/windows-7/

1. Get a USB stick – need a 4 gig one here – the ISO is about 2.5 GIG

2. Format the USB as NTFS (use quick – no need for sector check) – it MUST be NTFS

3. Run DISKPART from an elevated command prompt

4. Make the new USB volume “ACTIVE”

5. Extract the Win7 ISO somewhere (not the USB) – you can use ImgBurn, IsoBuster, WinRar or some tool that can extract direct from an ISO – or mount with Daemon tools or similar, then copy the files from there.  We need to extract first as we’ll need to run a quick program off of the Win7 ISO

6. On the recent Win7 extract, change to the BOOT subdirectory

7. Run BOOTSECT /NT60 <targetDrive:>

       where , <targetDrive> is the drive the USB stick is mounted as….

8. Copy all the files from step 5 above to the ROOT of the USB stick (with subdirectories of course)

Now, you may be able to skip step 5 copying files across and running BOOTSECT directly – I hadn’t but doesn’t necessarily mean it won’t work.

 

 

del.icio.us Tags: ,,
posted @ Monday, May 04, 2009 6:21 AM | Feedback (3)
Thursday, April 30, 2009
Thanks Jukka – MOSS 2007 SP2 Upgrade Failure – Solution!

During an upgrade, the psconfig command fails with

Failed to upgrade SharePoint Products and Technologies.

An exception of type Microsoft.SharePoint.Upgrade.SPUpgradeException was thrown.

Quick live search and I find on Jukka’s blog the answer:

http://blogs.msdn.com/jukka/archive/2009/04/30/error-during-sharepoint-sp2-install.aspx

Specifically, a feature was not installed, and quickly installing using the stsadm command Jukku provides, it then works…

posted @ Thursday, April 30, 2009 3:49 PM | Feedback (0)
Saturday, April 04, 2009
Couple of Visio Links

Visio is my primary diagramming tool.  I wanted to point out a couple of recent links I came accross that help in diagramming various things.

The first are stencils that are used on MSDN and TechNet diagrams – these are a set of stencils that can be used in Visio just by adding the stencil to the list for your diagram.  Located here:

Visio stencils for IT Pro posters

http://www.microsoft.com/downloads/details.aspx?familyid=08105458-1D92-44AD-B7E0-744AA853A7BF&displaylang=en

The other is Visio Toolbox.

This site is a hosted by Microsoft that provides basic background but there is a new add-in along with some others.  The new add it just release

There are Add-ins, Templates, and Tools

Visio Toolbox

Some of the Add-ins

WBS Modeler

New Rack Server Virtualization Add-In for Visio 2007 Pro

System Center Add-In

Disk Space Monitoring Add-In

Software Upgrade Assessment Add-In

Folder Access Rights Map

Microsoft Exchange Server 2007 Visio Add-in

PowerShell for Visio

There’s also a tool that will build a stencil for you if you just upload some images.. That’s here:

http://visiotoolbox.com/en-us/Iconset.aspx?resourceid=1

posted @ Saturday, April 04, 2009 9:26 AM | Feedback (0)
Thursday, April 02, 2009
SharePoint Designer is now “Free”

Get your copy now …

Mentioned here: http://office.microsoft.com/en-us/sharepointdesigner/FX100487631033.aspx

Direct Link here:

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=baa3ad86-bfc1-4bd4-9812-d9e710d44f42

Registration required…  Well, almost free

posted @ Thursday, April 02, 2009 8:37 AM | Feedback (0)
Thursday, February 26, 2009
Kerberos Configuration Troubleshooting

I wanted to post about one of the best tools I’ve found for getting Kerberos properly configured and in the process getting some great HOWTO information on Kerberos, how it works, etc.

When working with SharePoint, and the plan is to have your site run under Kerberos, I recommend using this tool before actually provisioning the Web App.  You can do it later, but you’d have to “stop” the WSS provisioned Web App before using this tool.  Why?  Because the IIS site you use for testing must use the DNS name of the Web App – that ultimately is the key to Kerberos – getting all the SPN (servicePrincipalName) set for the right AD Principals.

Basically, before actually creating or extending your web app in SharePoint, which would provision the Web App in IIS, you setup an standard IIS ASP.NET Virtual Host in IIS using the same DNS name as the eventual SharePoint Web App, set the App Pool to the Principal that going to be the App Pool for the Web App, then, put the DeleConfig files in the IIS site and hit the default page; gives fantastic diagnostic information on if Kerberos is setup correctly.  I'd suggest this as a first step... 

http://blogs.iis.net/brian-murphy-booth/archive/2007/03/09/delegconfig-delegation-configuration-reporting-tool.aspx

http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1434

Technorati Tags:
posted @ Thursday, February 26, 2009 8:17 AM | Feedback (1)
Wednesday, February 18, 2009
SharePoint learning resources.

Here are several links to some good resources:

Sales

http://blogs.msdn.com/sharepointserver2007trainingcanada/archive/2009/02/10/sales-sharepoint-server-2007-training-resources.aspx

Architect

http://blogs.msdn.com/sharepointserver2007trainingcanada/archive/2009/02/10/architect-sharepoint-server-2007-training-resources.aspx

Developer

http://blogs.msdn.com/sharepointserver2007trainingcanada/archive/2009/02/10/developer-sharepoint-server-2007-training-resources.aspx

Implementer

http://blogs.msdn.com/sharepointserver2007trainingcanada/archive/2009/02/10/implementer-sharepoint-server-2007-training-resources.aspx

 

And on Kirk Evan’s blog links to a whole bunch more…

http://blogs.msdn.com/kaevans/archive/2009/02/17/free-sharepoint-developer-resources.aspx

posted @ Wednesday, February 18, 2009 9:44 PM | Feedback (0)
Monday, February 16, 2009
SourceSafe in the Cloud – a second life for VSS

This post in no way endorses the use of Visual Source Safe, Mesh, or general supportability of this approach.  This is entirely at your own risk….

Visual Source Safe (VSS) has been around for some time.  There have been a few 3rd parties, then Microsoft, that implemented some nice server side capabilities such as Source Off Site (SOS), VSSConnect, and now in VSS internet based access. 

The issue with the server approach is that all of these requires some process to be running and hosting some part of VSS all the time.

What happened if you just used Mesh and shared the VSS DB folder (it’s just a folder) in Mesh and shared that way?

Well, I can say that for the past several weeks, I’ve been successfully working on a couple of different machines, doing check-in/out and it’s looking like no major issues so far.  Now, to be clear, this is just 1 user in a non-concurrent mode access the Mesh folder (when it’s local) from different machines.  Mesh gladly in the background syncs all the changes up to the “cloud” and when I’m online with the other machine those changes, and all status, etc. come down nicely…  I’ve even run analyze several times to just be sure..

image

posted @ Monday, February 16, 2009 8:22 PM | Feedback (0)
Friday, February 13, 2009
Try spending some time in the cloud…

Cloud services that is.  Windows Azure, .NET Services, Live Services….

If you looking for the spoon fed variety of information, a bunch of HOWTO vides have been released – see below.

These are small little “nuggets” – like those MSDN Nuggets out of Microsoft UK.

image

Get Started Developing on Windows Azure?

If you’re a developer and you’re new to Windows Azure, start here! You’ll see what you need to download and install, and how to create a simple “Hello World” Windows Azure application.

Deploy a Windows Azure Application

You’ll see what it takes to move your application into the cloud – you’ll see how to request and register a token, how to upload your Windows Azure application and how to move it between staging and production in the cloud.

Store Blobs in Windows Azure Storage?

Learn how to leverage Windows Azure storage to store data as blobs. You’ll learn about blob storage, containers and the API that makes it easy to manage everything from managed code.

Leverage Queues in Windows Azure?

Learn how to use queues to facilitate communication between Web and Worker roles in Windows Azure.

Debugging Tips for Windows Azure Applications

The Windows Azure SDK includes a development fabric that provides a "cloud on your desktop." In this screencast, learn how to debug your Windows Azure applications in this environment.

Get Started with .NET Services?

.NET Services are a set of highly scalable building blocks for programming in the cloud. In this brief screencast, you'll learn about the registration process, the SDK and the built-in samples - everything you need to know in order to get started.

Harness the Microsoft .NET Service Bus?

The .NET Service Bus makes it easy to access your Web services no matter where they are. In this brief screencast, you'll see how to take a basic Windows Communication Foundation (WCF) service and expose it to the Internet with the .NET Service Bus.

Get Started with the Live Framework?

If you are looking to get started developing with the Live Framework, this is the place to start! In this screencast you'll learn how to get a Live Services token and what you need to download in order to start writing Live Framework applications.

Use the Microsoft Live Framework Resource Browser?

The Live Framework Resource Model is a simple, straightforward information model based on entities, collections and relationships. In this brief screencast you'll learn how to navigate the relationships between entities by using the Live Framework Resource Browser, which is a tool that ships with the Live Framework SDK.

posted @ Friday, February 13, 2009 8:59 AM | Feedback (0)
News





Tag Cloud