Microsoft PlayGround

A Playground for Microsoft Technologies

Failure in loading assembly

In the application event log I found several errors that were pointing to assemblies that I wasn’t using anymore. The error looks like the message below:

Error: Failure in loading assembly: Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=Token.

The application was trying to load an assembly that I wasn’t in the GAC or in the BIN folder. This causes the error so I searched trough the complete solution for references to the specified assembly but couldn’t find any.

After searching I opened the web.config file of the web application and the one from central administration and saw that there were safecontrols registered to assemblies that I wasn’t using anymore.

<SafeControl Assembly="Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=Token" Namespace="Namespace" TypeName="*" Safe="True" />

By deleting these safecontrols the problem was solved.

Visual Studio 2010 Release Candidate is Available

Visual Studio 2010 Release Candidate iconIf you haven’t noticed. A few day’s ago the Release Candidate of Visual Studio 2010 became available.

The new version really feels a lot faster and is also about 1GB larger. Go try it out and let me know what you think.

Visual Studio 2010 Release Candidate

 

You can download the following version from the download center:

Inline Editing in SharePoint 2010 (UI and Code)

Within SharePoint 2010 it is possible to enable inline editing on list items. This can be done by changing properties on a view of a SharePoint library what can be done in code and trough the user interface.

To allow inline editing trough the user interface you have to do the following:

Navigate to the list for which you want to allow inline editing:

List settings

Click on list and then list settings. On the list settings screen click on the list view you would like to edit on the bottom of the screen:

List settings screen

In the view screen you have a section called: Inline editing. Within that section you have a checkbox to allow inline editing:

Enable inline editing

When you have enabled this checkbox you can inline edit the items in your list:

Inline Editing

Inline editing can also be enabled trough code. You can do this by following the code example below:

using(SPSite site = new SPSite("URL of the site"))
{
    SPWeb web = site.RootWeb;
    SPList list = web.Lists["Name of the list"];

    SPView view  = list.Views["Title of the view"];
    view.InlineEdit = "TRUE";
    view.Update();
}

 

The ‘InlineEdit’ property on the view is in the public beta version of SharePoint 2010 a string value. Hopefully they will change this to a Boolean value in the final version.

Microsoft Visual Studio 2010 Gets New Launch Date

In late 2009 Microsoft added an extra test release to the schedule of Visual Studio 2010. This resulted in a push-back of the launch date of the product.

Microsoft had now rescheduled the official launch event for VS 2010 and .Net 4.0 from 22 March to April 12.

 

More information about Visual Studio 2010 can be found here:

 

source: http://blogs.zdnet.com/microsoft/?p=4981

Hiding the ‘Create Site’ option in the Site Actions menu

Within SharePoint you have something called custom actions. You can use custom actions to create custom menu items within SharePoint. Besides custom actions you also have hide custom actions to hide custom actions. With the hide custom actions you can only hide custom actions that have been created with a CustomAction schema file.

The ‘Create Site’ menu options and also the ‘Create Page’ option are not created with a custom actions but on a different way. To hide these custom actions you can alter a file that resides in the masterpages gallery within a site collection.

In the masterpages gallery there is a folder called ‘Editing Menu’ in this folder there are four files you can use to alter certain menu options.

When you would like to hide the ‘Create Site’ action in the site actions menu you have to alter the CustomSiteAction.xml file by adding several nodes. Below there is an example of a CustomSiteAction.xml file that hides the ‘Create Site’ action:

 

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
&lt;Console&gt;
    &lt;references&gt;
	&lt;reference TagPrefix=&quot;cms&quot; assembly=&quot;Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&quot;   namespace=&quot;Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions&quot; /&gt;
    &lt;/references&gt;
    &lt;structure&gt;
 	&lt;ConsoleNode ConfigMenu=&quot;Delete&quot; ChangedNodeID=&quot;wsaCreateSite&quot; /&gt;
    &lt;/structure&gt;
&lt;/Console&gt;

The reference is to a SharePoint assembly that creates the custom actions. The ‘ConsoleNode’ stated what should happen with a certain menu action in the above example it is ‘ChangeNodeID’ which is ‘wsaCreateSite’ (This id can be found be looking in the source of the page). If you would also like to hide the ‘Create Page’ action you add the following line to the CustomSiteAction file:

&lt;ConsoleNode ConfigMenu=&quot;Delete&quot; ChangedNodeID=&quot;wsaCreatePage&quot; /&gt;

These changes can also be done with a feature and a feature receiver if you guys would like to have a example how to accomplish this let me now and also if you would like to see some examples for the other files.