BDBits Bytes

Entries from July 2008

How to copy an assembly from the GAC

July 1, 2008 · Leave a Comment

The Windows Global Assembly Cache (GAC) is where our developers have been putting shared components for SharePoint web applications. It is a rather vague and somewhat virtual place on the hard drive, usually thought to be located at %windir%\assembly, which is somewhat true. Read on. :)

If you want to copy a file to it, you have to use Windows Explorer and drag-and-drop it into %windir%\assembly. Oddly enough, however, you can’t drag-and-drop or cut-and-paste an assembly out of the GAC in Windows Explorer. If you drop to a command line and cd %windir%\assembly then do a dir, you will not see the list of assemblies you see in Windows Explorer. Instead there are a series of folders corresponding to different assembly types, and folder inside those corresponding to different assemblies and versions thereof. So how do you get something out of the GAC anyway?

If your assembly is named mycode, drop to a command line and cd %windir%\assembly. Now do a search for it with dir mycode* /s/b/p. The result should include a line showing your file with the full path. Now you can use a regular old copy command to copy it somewhere else.

This is most certainly not the full story on the GAC, but hopefully it is enough to enable you to figure it out for your particular situation.

Categories: SharePoint

Unblock a nonstandard port in Firefox3

July 1, 2008 · 2 Comments

At work yesterday, I was configuring a proxy server for a new company web site. For reasons beyond my control, it is running on port 87 instead of port 80, so the URL looks like http://somewhere.example.com:87/. When you try and load the site in Firefox 3, you get this friendly message:

Firefox 3 blocking message

If you can’t see the screenshot, it says: “This address uses a network port which is normally used for purposes other than Web browsing. Firefox has canceled the request for your protection.” They then offer you the utterly useless Retry button. What is going to change when you click Retry? Instead, there ought to be a way that lets you say “I really do understand that, let me do this anyway”. But there is nothing availabe here or in Tools->Options that lets you work around this behavior. Fortunately, there is a solution in about:config.

This is a special “page” built in to Firefox; enter about:config in the address bar. If you’ve never been here before, you will get a warning; you may want to uncheck the Show this warning next time before you click I’ll be careful, I promise!! button. Now right-click anywhere in the lower portion of the resulting page and select New and then String from the context menu. The name you need to enter is network.security.ports.banned.override, and the value is the port(s) you want to open. If you have more than one, enter them as a comma-separated list. That’s it, no need to restart your browser or do anything else, it should just work now.

Apparently, port 87 has had security exploits in the past, so the Mozilla folks really are trying to protect us. And also from what I read, this same restriction was in Firefox 2 and perhaps earlier versions. Since I no longer have FF2 available on any of my computers, I cannot confirm that. Mozilla developers: can’t we put things like this in some kind of GUI option so we can find stuff without endless Google searching? Thanks.

Categories: Firefox