0

I am creating a "Hello world" web part in Visual Studio 2015 and deploying it on SharePoint Foundation Server. It works: I can add it from "Custom web parts" and display it on a page.

Then I'm publishing it (Build-> Publish...-> Publish to file System) and try to add the published file to SharePoint in Office 365 following this tutorial:

http://sharepoint-community.net/profiles/blogs/sharepoint-online-2013-web-part-deployment

Unfortunately I'm failing on step 7 - Activating Web Part - receiving this error:

"Sorry, something went wrong
Error validating assembly 'VisualWebPartProject6.dll'.
StringNotFound
TECHNICAL DETAILS"

There are no addidtional imports or anything like that. It is just a plain web part created in Visual Studio 2015 and a label created in designer with label.text = "hello world" within Page_Load.

How can I export my web part to SharePoint in Office 365?

-Edit
This is "Sandbox solution".
When im uploading(SharePointProject1.webpart) file directly on site im getting
($Resources:core,ImportErrorMessage;)

2 Answers 2

1

this is an unfortunate problem with VS 2015 building sandboxed solutions for Office 365. The workaround is to just use VS 2013. Open the existing project, rebuild and publish. It will work.

EDIT: problem is still there with Update 2 for VS 2015 and Update 2 for Office Developer Tools for VS 2015

1
  • That's the solution. I have 2 version of VS. 2013 and 2015. Nothing changed, just deployed it with 2013 and it worked. Commented Jul 12, 2016 at 13:28
0

A few hints:

  • You probably created a "Farm solution" (as opposed to "Sandbox solution").
    The article you mention is about "Sandbox solutions".
  • In Office 365, you can only deploy Sandbox solutions, no Farm solutions.
  • The choice between Farm or Sandbox is made when you first create the project in Visual Studio.
  • Sandbox solutions can also be deployed on-premises.
  • Sandbow solutions are deployed at the site collection level, not at the farm level. To deploy a Sandbox solution, you upload the WSP file into the site collection solution galery.
  • Sandbox solutions are developped with same concepts than Farm solutions (code compiled into a DLL, features, SharePoint artefacts such as Web parts, custom actions..., WSP) but are limited to a small sub-set of the possibiltiies of the Farm solutions (mainly in the C# API you can use; most of the time, objects "above" the site collections cannot be used, as well as access to the disk or to the network).
  • Sandbox solutions were introduced in SharePoint 2010 to allow safe/controllable code to be deployed in the cloud (e.g. Office 365).
  • Sandbox solutions are still supported in SharePoint 2013 but are officially deprecated in favor of "Apps" (aka Add-ins).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.