Make Visual Studio work with VMWare Fusion Shares

August, 19. 2009 at 05:17 PM

VMWare Fusion allows Mac users to run virtualized operating systems. The “Shared Folder” feature allows for sharing profile folders on the Mac (Desktop, Documents, Music, Pictures) with virtualized operating systems. Having a shared work space eliminates the need for duplication of files that need to be used in both operating systems.

I run a virtualized Windows XP operating system so that I can code in Visual Studio on my Mac. I prefer to do design (HTML, CSS) on the Mac side of things. Having shared storage for use in my projects eliminates the need to copy back and forth. It also allows me to backup my Visual Studio projects using Time Machine without having to make a copy of my VM every time. However, to make Visual Studio happy with the shared Documents folder, there some settings that need changed.

Change the Documents folder location to be a mapped drive

When working with web projects located on shared storage, Visual Studio doesn’t like the .host location shared by VMWare because of the dot in front of the share name. This is resolved by mapping the .host share to a network drive, and setting the My Documents folder in Windows to be located on the network drive. VMWare automatically maps its shares to the Z drive.

Get rid of the “failed to start monitoring changes” build error

Visual Studio’s default behavior is to monitor folders in web projects for changes. Because the Documents folder is on a UNC share, this behavior prevents web projects from building. The only solution I have found is to disable this behavior.

  1. Open regedit and navigate to HKLM\Software\Microsoft\ASP.NET\
  2. Create a new DWORD value named FCNMode
  3. Set FCNMode to have a decimal value of 1

Get rid of the “Project location not trusted” error

By default, the .NET configuration will not trust the shared folders from VMWare for projects. You will see an error when opening projects from the shared folder.

You must tell .NET to trust the location. Install the .NET Framework 2.0 SDK.When installing, you will only need “Tools and Debugger”; uncheck everything else. After the install, you will have a new tool under Administrative Tools for .NET 2.0 configuration.

  1. Open the .NET configuration tool
  2. Expand the tree on the left side to My Computer > Runtime Security Policy > Machine > Code Groups > All Code > LocalIntranet_Zone
  3. Right click on LocalIntranet_Zone and select the “new” option to create a new code group
  4. Name the code group “.host” (without the quotes) and click next
  5. Change the condition type dropdown to URL and enter “file:\\.host\*” (without the quotes) in the URL text box type and click next
  6. Choose “Full Trust” as the existing permission set, click next, then click finish. You should see a .host in the LocalIntranet_Zone as shown below. Save and close all windows.

 

You will now need to tell Internet explorer that .host is a trusted zone.

  1. Open up IE and go to Tools –>Internet Options
  2. Go to the Security tab, highlight Local Intranet and click the sites button
  3. Click the advanced button. In the “Add this website to zone” text box, type “file://..host/*” without the quotes and click add. Save and close all windows.

You’re all set. Visual Studio will now work with VMWare Fusion’s shared folders. Happy coding.

 

Flickr Gallery Modified for GoDaddy

July, 29. 2008 at 06:55 PM

Danny Douglass created an excellent flickr photo gallery for Blogengine.NET. It's located here. Since GoDaddy is my host, I have to deal with medium trust issues, so Danny's gallery wouldnt work for me. Fortunately, Danny released the source for this module, so I modified it for my purposes.

After debugging a bit, I found that the security on my IIS 7 hosted site wouldn't allow me to cache downloaded flickr photos. You would think that I could just point the cache folder to one on my site with write permissions. Unfortunately, the FlickrNET provider that the gallery was built with asks for a location in the <drive>:\<folder> format (for example: c:\Inetpub\temp). I noticed that it would be possible to find out the drive/folder location of my site on my webhost, but its likely my website wouldn't be able to access the local file system, so I didn't go wandering down that road. Besides, who knows when they might change it.

To get things going, I simply disabled the the flickr caching. The first function that is called when the gallery is accessed is called GetPhotoSets(). I added Flickr.CacheDisabled = true; as the first line of module to make this happen. I rearranged some other code as well, but this was the main thing.

To use my modified version:

  1. Remove any previous installations first (remove the files)
  2. Unzip the contents of the attached zip of to the root of your website
  3. Add your flickr api key, shared secret, etc to your web.config (same as Danny's original)
  4. Reference the theme being used in Default.aspx and PhotoAlbum.aspx (same as Danny's original)
  5. Create a content place holder called "scriptholder" in the head section of your selected theme site.master (add <asp:ContentPlaceHolder ID="scriptholder" runat="server" />)
  6. Go to <your website url>/photos
  7. Go to Danny's website to thank him for his great Blogengine.NET addition 

 


BlogEngineFlickrPhotos.zip (115.79 kb)

Web.Config (14.29 kb)

Site redesign in progress

October, 11. 2007 at 02:26 AM

Alas, I have moved away from PHP and MySQL (wordpress) towards .NET and MSSQL (blogengine.net), although I still have many negative feelings towards Microsoft (mostly because of their licensing/DRM policies) and many positives toward open source and freedom from cost. Wordpress rocks, don't get me wrong; boy wordpress and I sure had a lot of fun. Yet, I am training for MS certifications, and coding in dotnet just comes natural anymore. Plus Visual Studio 2k5 blows any php editor out of the water. With the advent of .NET being released to the open community by Microsoft, I foresee a foothold on the web app scene by .NET. Besides, any one who codes both languages knows that that C# is a more polished C language than PHP is anyway; plus its available class library is far more organized. I dig organization, now if I could just get over the whole selling out thing... oh and I love my Xbox.