Saturday, February 20, 2010

Could not load file or assembly 'AntiXssLibrary, Version=3.1.3524.16873, Culture=neutral, PublicKeyToken=d127efab8a9c114f' or one of its dependencies.




Exception:
Could not load file or assembly 'AntiXssLibrary, Version=3.1.3524.16873, Culture=neutral, PublicKeyToken=d127efab8a9c114f' or one of its dependencies.

Required permissions cannot be acquired.

Cause:
The hosting environment is configured for Medium Trust and AntiXssLibrary is compiled using the "unsafe code" flag by default.

Solution:
1. In order to test this on your development comp you'll need to go into your web.config file and add a node
<trust level="Medium"> somewhere between <system.web></system.web>

2. Download the source code for AntiXSSLibrary, located here: http://antixss.codeplex.com/SourceControl/changeset/view/28744# and click on Download button

3. Open up the project in Visual Studio and right-click on the AntiXSSLibrary project.

4. Build tab, uncheck "Allow unsafe code" as seen below. NOTE: This cant be done in version 3.1, so only try it in version 3.0



5. Add [assembly: System.Security.AllowPartiallyTrustedCallers()] to AntiXssLibrary project AssemblyInfo.cs (located under Properties folder), as seen below










6. Recompile the project, and then add the reference to your project and test.


References:
1. http://msdn.microsoft.com/en-us/library/ms998341.aspx
2. http://forums.iis.net/t/1164637.aspx
3. http://antixss.codeplex.com/Thread/View.aspx?ThreadId=44517



Wednesday, February 3, 2010

Please configure the Windows SharePoint Services Timer service to run as a domain account



1. Start->Control Panel->Administrative Tools

2. Click on Services

3. Navigate to "Windows SharePoint Services Timer"

4. Right-click on it and choose "Properties"

5. Click on the "Log On" tab

6. Choose "This Account" and specify an account on your company's domain.

Note:
Preferably this account should be specially setup only for the purpose of running this timer, but you can use any account that's already setup if you choose to do so.
There was an error in this gadget