Monday 5 December 2011

Could not load file or assembly “xxx.dll", PublicKeyToken=null” or one of its dependencies. The system cannot find the file specified in .NET 4.0

After we virtualized a production machine and booted this virtualized machine, .NET reported some errors after re-registering .NET 4.0 on IIS7 these error where resolved, but one WCF service kept on logging the error:

Could not load file or assembly ‘App_Web_squ1ikqu, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. The system cannot find the file specified.

Solution

The error was resolved after stopping all application pools in IIS7 and deleting the temporary internet files in the following folders:

    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files

http://www.roelvanlisdonk.nl/?p=2081

Friday 11 November 2011

The page you are requesting cannot be served because of the extension configuration

Error: The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

Solution:

In Web.Config;

<system.webServer>

<staticContent>
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
<mimeMap fileExtension=".m4v" mimeType="video/m4v" />
<mimeMap fileExtension=".ogg" mimeType="video/ogg" />
<mimeMap fileExtension=".ogv" mimeType="video/ogg" />
<mimeMap fileExtension=".webm" mimeType="video/webm" />

<mimeMap fileExtension=".oga" mimeType="audio/ogg" />
<mimeMap fileExtension=".spx" mimeType="audio/ogg" />

<mimeMap fileExtension=".svg" mimeType="images/svg+xml" />
<mimeMap fileExtension=".svgz" mimeType="images/svg+xml" />

<remove fileExtension=".eot" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".otf" mimeType="font/otf" />
<mimeMap fileExtension=".woff" mimeType="font/x-woff" />
</staticContent>


</system.webServer> 

Sunday 25 September 2011

SharePoint 2010 Mobile Site Disable

Web.Config


<system.web>
<browserCaps>
<result type="System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<filter>isMobileDevice=false</filter>
</browserCaps>
</system.web>

SharePoint Backup and Restore

Backup

stsadm -o backup -url http://sharepointsite -filename D:\Backup\backup.bak

Restore

stsadm -o restore -url http://sharepointsite -filename D:\Backup\backup.bak -overwrite

Thursday 22 September 2011

Anonymous Users cannot open XLSX files from a SharePoint document library

$siteUrl = "http://URL_of_your_SITE";
$site = New-Object Microsoft.SharePoint.SPSite($siteurl);
$web = $site.OpenWeb();

$enumPerms = [Microsoft.SharePoint.SPBasePermissions];

Write-Host $web.AnonymousPermMask64;
$web.AnonymousPermMask64 = $web.AnonymousPermMask64 -bor $enumPerms::OpenItems
$web.Update();
Write-Host $web.AnonymousPermMask64;

$web.Dispose();
$site.Dispose();


http://support.microsoft.com/kb/2498047

Wednesday 3 August 2011

Unable to add selected web part

ERROR:
Assemblies that implement ASP.NET Web Parts and are installed into a partially trusted location, such as the bin directory, must be compiled with the AllowPartiallyTrustedCallersAttribute set for import to succeed.

SOLUTION:
Add [assembly:AllowPartiallyTrustedCallers] to AssemblyInfo.cs

Thursday 28 July 2011

SharePoint 2010 Change your display of welcome name

In Powershell:

Set-SPuser -identity “DOMAIN\accountname” -DisplayName “Name Surname” -web <URL of Site>

Monday 18 July 2011

SharePoint Config database log file too big. Solve it! :)

USE SharePoint_Config
GO
ALTER DATABASE SharePoint_Config SET RECOVERY SIMPLE
DBCC SHRINKFILE(N'SharePoint_Config_log', 1)
ALTER DATABASE SharePoint_Config SET RECOVERY FULL
GO

Sunday 22 May 2011

XPath: Get attribute by maximum value

xpath: /root//node[not(@y <= preceding-sibling::node/@y) and not(@y <=following-sibling::node/@y)]
XmlDocument doc = new XmlDocument();
doc.Load("data.xml");
XmlNodeList nodeList = doc.SelectNodes("/root/node[not(@score <= preceding-sibling::node/@score) and not(@score <=following-sibling::node/@score)]");
StringBuilder output = new StringBuilder();
output.Append("<b>");
for (int i = 0; i < nodeList.Count; i++)
{
output.Append("<b " +
nodeList[i].ParentNode.Attributes["parentAttribute1"].OuterXml + " " +
nodeList[i].ParentNode.Attributes["parentAttribute2"].OuterXml + ">");

output.Append(nodeList[i].OuterXml);
output.Append("</b>");
}

output.Append("</b>");

Monday 16 May 2011

Sign out problem in SharePoint 2010

I solved my problem :)


  if (HttpContext.Current.Request.Cookies["FedAuth"] != null)
{
HttpCookie requestCookie = new HttpCookie("FedAuth");
requestCookie.Secure = false;
requestCookie.Expires = DateTime.Now.AddYears(-1);
}
FederatedAuthentication.SessionAuthenticationModule.SignOut();
FormsAuthentication.SignOut();

Response.Redirect("~/redirecturl");

Friday 29 April 2011

SharePoint 2010: Customize AccessDenied, Confirmation, Error, Login, RequestAccess, Signout, WebDeleted url

In SharePoint Powershell:

Set url:

PS C:\Users\User> Set-SPCustomLayoutsPage -Identity "Signout" -RelativePath
"/_layouts/CustomSignout.aspx" -WebApplication http://webappurl

Get url:

PS C:\Users\User> Get-SPCustomLayoutsPage -Identity "Signout" –WebApplication “http://webappurl

Moss How to remove My settings in Welcome Menu

1. Take a copy of Welcome.ascx file (under 12 hive\Template\ControlTemplates folder)
2. Rename it as CustWelcome.ascx
3. Find the tag with Personalization For Eg:

<SharePoint:MenuItemTemplate runat=”server” id=”ID_PersonalInformation”
     Text=”<%$Resources:wss,personalactions_personalinformation%>”
     Description=”<%$Resources:wss,personalactions_personalinformationdescription%>”
     MenuGroupId=”100″
     Sequence=”100″
     ImageUrl=”/_layouts/images/menuprofile.gif”
     UseShortId=”true”
     Visible=”true”
     />
Change the Visible to false (if visible is missing add it and set it as false)

<SharePoint:MenuItemTemplate runat=”server” id=”ID_PersonalInformation”
     Text=”<%$Resources:wss,personalactions_personalinformation%>”
     Description=”<%$Resources:wss,personalactions_personalinformationdescription%>”
     MenuGroupId=”100″
     Sequence=”100″
     ImageUrl=”/_layouts/images/menuprofile.gif”
     UseShortId=”true”
     Visible=”false”
     />

Now go to the master page and change the reference from welcome.ascx file to CustWelcome.ascx

http://ganpages.wordpress.com/2009/12/07/moss-2007-hide-my-settings-menu-item/

Monday 21 February 2011

SecurityToken Problem

Problem:

The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs

Solution:

\14\WebServices\SecurityToken

I changed to the web.config there to add this in the behaviors

<serviceDebug includeExceptionDetailInFaults="true"/>