Search
Archives

You are currently browsing the ZMeier.com blog archives for February, 2012.

Archive for February, 2012

Problem Description:

This problem is caused by moving your User folders ( Documents, Downloads, Favorites, Saved Games, Music, Pictures, etc )
More specifically when you move them to a Drive that is then disconnected.

This will cause problems when attempting to isntall any programs that use these folders.

Possible Errors

  • Error 1327.invalid drive:E\
  • Error 1327.invalid drive:F\
  • Error 1327.invalid drive:G\
  • Error 1327.invalid drive:H\

Fix:

Easy Method:

Since this is caused by moving your User Folders simply attempt to move them back. If this doesn’t work you will have to do it the manual method.

Manual Method:

  1. Hit Win+R and type regedit and hit [ OK ]
  2. If windows user account control shows up hit Yes
  3. Backup your registry
    1. Click File->Export
    2. Change Export Range at the bottom to  (x) All
    3. Enter a filename and hit [ Save ]
  4. Expand the follow folders shown below
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
  5. Once in this directory look at the values of the keys you will see that they are pointing to the place you moved your user folders.
    In my case they were on a drive F:\Backup\Documents, F:\Backup\Music
  6. You will need to either delete these values or a better solution recreate the folders or move the folders back and then change the values
  7. Create the missing folders under your user
  8. Click on each value pointing to the wrong folder and correct the value to c:\Users\[user]\…
    i.e. if you username is Admin change F:\Backup\Documents to c:\Users\Admin\Documents

References:

  • http://www.hardwareanalysis.com/content/topic/56803/
  • http://answers.microsoft.com/en-us/windows/forum/windows_vista-windows_programs/error-1327invalid-drive-f/4b31360a-97c3-451e-aa34-29e1c356e5e6

Senario


Upgrading from WSS 3.0 or SharePoint 2007 to SharePoint 2010
I’ve encoutered this many times I figured I would add it up.

Problem Description


Only one instance of a ScriptManager can be added to the page.

Fix Explanation

SharePoint 2010 already has a ScriptManger in its defalut.master so if you extend form there you will need to remove the ScriptManger on your page and everything will work!

ScriptManger in default.master and v4.master

<asp:ScriptManager id="ScriptManager" runat="server" EnablePageMethods="false" EnablePartialRendering="true" EnableScriptGlobalization="false" EnableScriptLocalization="true" />


Modify the SharePoint 2010 ScriptManger properties from your project:

protected void Page_Init(object sender, EventArgs e){
ScriptManager current = ScriptManager.GetCurrent(Page);
current.AsyncPostBackTimeout = 36000;
current.EnablePartialRendering = true;
}

 

Senario

Problem Description:

The type or namespace name ‘ConfigurationManager’ does not exist in the namespace ‘System.Configuration’ (are you missing an assembly reference?)

Fix:

Go to Project References and add System.Configuration from the .Net tab

 


Problem description


Feature ‘optional parameter’ cannot be used because it is not part of the 3.0 C# language specification

Uable to use Optional parameters in a Project targeting .net 3.5 or .net 3.0. Often times the server will support optional parameters as well as Visual Studio 2010.


What are Optional Parameters


public void MyMethod(String requiredParam, String optionalParam = String.Empty, Int32 optionalInt = 0) {}
The parameters followed by = sign are known as optional parameters and value after the equals sign the default value, which was a nice feature of C that C# originally had not replicated.

It saves you form having to create several methods like this:

public void MyMethod(String requiredParam) { MyMethod(requiredParam, String.Empty, 0); }
public void MyMethod(String requiredParam, String optionalParam = String.Empty) { MyMethod(requiredParam, optionalParam, 0) }
public void MyMethod(String requiredParam, String optionalParam = String.Empty, Int32 optionalInt = 0) {}


My Specific Senario (SharePoint 2007 to 2010 upgrade)


My specific senario is a SharePoint 2010 Custom Project. Specifically a couple layouts based application pages.
I am upgrading form a SharePoint 2007 Solution. So optional parameters are also available in SharePoint 2007 and WSS 3.0.

Fix


Go to project properties -> Build Tab -> click button ‘Advanced’ -> set language version to ‘default’ -> save -> be happy 😉
Reference: http://stackoverflow.com/questions/1210679/can-you-use-optional-parameters-in-code-targeting-net-3-5