Search This Blog

Showing posts with label sharepoint C#. Show all posts
Showing posts with label sharepoint C#. Show all posts

Thursday, September 22, 2011

Errors while installing and configuring Sharepoint 2010


clip_image002
clip_image004
The Problems!
When installing SharePoint 2010 on Windows 7, even if you install all of its prerequisites that it says to install, you get one of these two errors:
An exception of type System.IO.FileNotFoundException was thrown.  Additional exception information: Could not load file or assembly ‘Microsoft.IdentityModel, Version 3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35′ or one of its dependencies.  The system cannot find the file specified.
-OR-
An exception oftype Microsoft.SharePoint.Upgrade.SPUpgradeException was thrown. Additional exception information: Failed to call GetTypes on assembly Microsoft.Office.Server.Search, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c. Could not load file or assembly ‘System.Web.DataVisualition, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find thefile specified.
-OR-
Failed to create the configuration database.
An exception of the type Microsoft.SharePoint.SPException was thrown.  Additional exception information: User cannot be found
(See both possible solutions below)
Below are the steps that I took to get these errors.
Installed SQL Server 2008 R2,  Installed SharePoint 2010 (with its prerequisites first).
Went to Start,  SharePoint 2010 Central Administraton
clip_image006
clip_image008
Clicked Yes
clip_image010
Clicked Next
clip_image012
WARNING: you are installing on windows vista or windows 7, which are unsupported configurations intended for use on developer workstations only.  This configuration should not be used as a production environment, or host any user content.
Clicked OK
clip_image014
Clicked Yes
You might get one of the errors below:
clip_image016
An exception of type System.IO.FileNotFoundException was thrown.  Additional exception information: Could not load file or assembly ‘Microsoft.IdentityModel, Version 3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35′ or one of its dependencies.  The system cannot find the file specified.
Click Finish.
The problem is that the Windows Identity Foundation pack was not installed.  This can be fixed here: http://www.microsoft.com/downloads/details.aspx?FamilyID=eb9c345f-e830-40b8-a5fe-ae7a864c4d76&displaylang=en#filelist
-OR-
clip_image018
An exception oftype Microsoft.SharePoint.Upgrade.SPUpgradeException was thrown. Additional exception information: Failed to call GetTypes on assembly Microsoft.Office.Server.Search, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c. Could not load file or assembly ‘System.Web.DataVisualition, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find thefile specified.
Click Finish.
The problem is that the Chart Controls cannot be found, you can download them here: http://go.microsoft.com/fwlink/?LinkID=122517
-OR-
clip_image020
Failed to create the configuration database.An exception of the type Microsoft.SharePoint.SPException was thrown.  Additional exception information: User cannot be found
Alright, this one is rather funny.  You can get this message if you are working from home, not connected to the network via VPN.  That was my case.  The user just cannot be found that is part of the domain for creating the SQL Server connection.
SUCCESS!!!
clip_image002[1]
That all worked for me, hope it works for you!

Type of events for document library.


Event Description
Cancel Check Out Changes made to a checked-out document are undone.
Check In A document is checked in to the library.
Check Out A document is checked out from the library.
Copy A document in the library is copied.
Delete A document is deleted from the library.
Insert A new document is saved to the library.
Move or Rename A document is moved or renamed.
Update An existing document or the value of a custom column in the library is edited.

Event Handler to prevent deletion of document from document library

  1. Start Microsoft Visual Studio 2010.
  2. On the File menu, point to New, and then click Project.



  3. In Project Types, under Visual Basic or C#, select Event Receiver.
  4. Type <Name for your project > as the project name. Click OK.
  5. In the SharePoint Customization Wizard, choose Deploy as a farm solution. Click Next.
  6. In the Choose Event Receiver Settings dialog, select List Item Events in the What type of event receiver do you want? choose from drop down dropdown.

  7. In the What item should be the event source? choose from dropdown, choose Tasks.
  8. Choose the An item is being deleted option in the Handle the following events list. Click Finish.
  9. In the EventReceiver1 file that is created, insert the following code in the ItemDeleting method.




using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;

namespace EventHandler
{
    class AnnouncementDeleteRevert: SPItemEventReceiver
    {
        public override void ItemDeleting(SPItemEventProperties properties)
        {
            string errorMessageToDisplay= ("Announcements can not be deleted from this list");
            properties.ErrorMessage = HandledMessage;
            properties.Cancel = true;


//or


properties.Status = SPEventReceiverStatus.CancelWithError;
properties.ErrorMessage = "Deleting items from " + properties.RelativeWebUrl + " is not supported.";
        }
    }
}

Featured Posts

Unlock Hidden Windows Startup and Shutdown Details : How to Enable Verbose Startup and Shutdown Messages in Windows 11

WINDOWS TROUBLESHOOTING · FULL GUIDE Unlock Hidden Windows Startup and Shutdown Details Enable Verbose Status...