Three Is It

Because two isn't enough and four is just too many

America does not go abroad in search of monsters to destroy.
President John Quincy Adams
Home Blogs Genealogy Brad's Bookshelf Subscriptions Contact Sign in
 

About the author

Brad Butts is a .NET developer and architect. He is married with children and enjoys reading, working out, and genealogy is his five minutes of spare time.
E-mail me Send mail
National Debt Clock

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010

Builds and references in the GAC

I've been doing some MSBuild experiments lately and pondering what a build server should look like and ran into an interesting challenge:

Suppose I am trying to build an application that references some third party assembly (a pre-built assembly that is not part of the solution being built)--a good example of this might be a project that references Log4Net.  How can I ensure that my solution will build successfully and not encounter broken references to the third party assemblies that I use?

I know how to reconcile broken references on my desktop--I covered that in my Resolving Reference Problems post.  However, I shouldn't be checking in .USER files in source control, so that solution isn't relevant here.

I could hardcode a full reference path to something like C:\Program Files\log4net, but how do I know that's where the Build Masters have installed the binary?

You're probably saying, "Brad, you dummy, just add the binary to a solutions folder in your solution and reference it with a relative path!"  Well, let's just assume that my friendly neighborhood Source Control policeman won't let me check in files that are not explicitly source code--of which, I guess, a DLL is not.  What now?

What's interesting is that, so long as MSBuild can find my third party assembly in the GAC of the build server, it doesn't matter where the DLL lives in the rest of the file system: C:\Program Files\log4net, C:\Program Files\some-mysterious-sub-dir, wherever (or nowhere, as in, the Build Master deletes the binary after he installs it to the GAC).

Further, if you create such a scenario on your Dev machine and open up the project in Visual Studio 2008, you don't get the dreaded broken reference symbol (and your solution will compile).  I wonder if that's a new thing in Visual Studio 2008?  I could have sworn that Visual Studio 2005 would still show me broken  references when my hintpaths wouldn't resolve to a physical assembly even if that assembly was in the GAC.  Hmm.

Anyway, I had several JPGs to attach showing how I arrived at my conclusions, but I don't think this little factoid is worth all that extra work.  However, feel free to play with the code yourself--attached are two solutions.  One produces a signed class library and the other is a WAP that references the DLL produced by the first solution.  Build that class library, put it in the GAC, delete it from the bin directory, then see how the WAP can still build successfully.

GACRefTest.zip (332.83 kb)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: Technology Blog
Posted by Brad on Friday, November 21, 2008 5:13 PM
Permalink | Comments (9) | Post RSSRSS comment feed

Hyperlink Text in a SharePoint 2003 List

Yes, it's 2008 and MOSS 2007 has been out for some time, but some of us are still flailing along with SharePoint 2003.  One gripe I have with SharePoint 2003 (among many), is the limited range of text markup you can do in a standard List--I guess this is largely due to the text editor control in SP2003.

One thing I would really like to do is create nice hyperlink text in the bodies of my list items.  Since the text editor control contains no feature to do this, I'm forced to literally paste hyperlinks into the body of my text.  This makes my posts less than attractive, but seems to be the only way to do it...until now.

The "Hack"

So, what I'd like to do is add a new item to, say, my Announcements list that looks like this:

Hey, everybody.  Be sure to check out Scott Guthrie's new list of .NET links.  There's some cool stuff there!

Notice that "list" is an anchor to the link I'm announcing.  Instead of that nice, tidy post, I have to do something like this:

Hey, everybody.  Be sure to check out Scott Guthrie's new list (http://weblogs.asp.net/scottgu/archive/2008/11/06/nov-6th-links-asp-net-asp-net-ajax-jquery-asp-net-mvc-silverlight-and-wpf.aspx) of .NET links.  There's some cool stuff there!

Here, I have to literally paste the link into the text of my post.  That might be fine for one or two links, but if I have several links to drop into my text, the text can become quite hard to read.  Well, recently, I stumbled upon a solution to my problem.

Step 1
In the text editor, just type up the text how I'd like it to look...



Step 2
Now, copy the ScottGu link in my clipboard and replace the word "list" with the ScottGu hyperlink...



Step 3
Now, very carefully, highlight the entire URL and type your link word over it: in this case, type the word "list" over it.  Notice that "list" takes on the appearance of a hyperlink!



Step 4
Save your post.  Now, you have nice, clean text in your list item and the hyperlink is still there, too!



The only problem I've found with this approach is if you wish to make your hyperlink text a phrase instead of a single word.  For example:

Hey, everybody.  Be sure to check out Scott Guthrie's new list of .NET links.  There's some cool stuff there!

In the SharePoint text editor, as soon as you hit that space between "new" and "list", the link seems to stop; thus, only "new" would become hypertext while "list" would remain plain, ordinary text.  If you must make an entire phrase a hyperlink, I guess you could either put an underscore (_) between words instead of a space or go through the trouble of repeating Steps 1-4 for every word in the phrase.  That might drive you crazy, but at least you'd have nice text!

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: Technology Blog
Posted by Brad on Thursday, November 06, 2008 5:58 PM
Permalink | Comments (8) | Post RSSRSS comment feed