Quantcast
Viewing all articles
Browse latest Browse all 10

Resolved: Could not load file or assembly ‘Microsoft.SharePoint.Sandbox, Version=12.0.0.0, Culture=neutral, PublicKeyToken=XXXXXXXXX’ or one of its dependencies…

I have a remote sharepoint solution that contains SharePoint dll’s reference. Whenever I run the solution, start page get crash and show me this error.

“Could not load file or assembly ‘Microsoft.SharePoint.Sandbox, Version=12.0.0.0, Culture=neutral, PublicKeyToken=XXXXXXXX’ or one of its dependencies. An attempt was made to load a program with an incorrect format.”

Well every time I run the project it creates Microsoft.SharePoint.Sandbox.dll and Microsoft.SharePoint.Sandbox.xml inside the bin folder and it creates the problem. Well there are lots many things have written on web regarding this problem. I follow all these things but could not get rid of this error. Finally I decided to fix this problem according to my way. So below are the steps to fix this problem permanently.

1. Inside solution explorer (Visual Studio), select the project and right click on that.

2. From context menu, click on properties.

3. When properties page opens, Click on Build Events.

4. Under Post – build event command line, copy and paste below lines

cd $(TargetDir)

del Microsoft.SharePoint.Sandbox.dll

del Microsoft.SharePoint.Sandbox.xml

Done!

NOTE: please replace with your dll name.


Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 10

Trending Articles