Sandbox Solutions removed from SharePoint Online–Here’s the fix for your Visual Studio developed WSPs to get them to activate

Today, Microsoft removed the ability to activate sandbox solutions with code in them.  That’s cool, we’ve all known for a couple years that coded sandbox solutions were going away and there’s a post on the office dev blog describing the change,  What wasn’t talked about was the fact that any time someone created a no code sandbox solution in visual studio, an assembly was automatically generated which will block it from being deployed as of today! 

This feel like a huge deal when you’re trying to deploy an update and things aren’t working, but the fix is pretty easy.  Lets walk it through:

 

First, you’ll see the issue preventing you from activating your solution. 

image

There are two different ways to solve this problem depending on if you still have access to the source code and visual studio.  If you do, you can update the project property Include Assembly In Package to false as shown in https://support.microsoft.com/en-us/kb/3183084

 

If you don’t want to rebuild your package in visual studio, follow the steps below to remove the assembly from the sandbox solution.

 

Click on the name of the .wsp file to download it to your computer.  We need to open it up and remove the dll from inside.

Once you’ve downloaded it, rename the .wsp to a .cab file. If you double click it now to open it with explorer you’ll see that dll file inside.

image

 

After extracting to the file system we have 2 changes we need to make.

  1. Delete the DLL
  2. Update the manifest

So in windows explorer lets just delete the dll.

image

 

Right click on the manifest.xml file and open it in the editor you love most.  I chose code here.  Then delete the entire Assemblies section of the file and save it.

image

image

 

Next we need to recreate our cab file.  I like using a free app called IZArch that will give you a GUI instead of using makecab.  Just create a new archive and give it a file name ending in .CAB

image

 

Add your files, close IZArch and find the CAB file with windows explorer.  Just rename it back to .WSP and you’re ready to upload it to SharePoint

image

 

As you can see below, the .WSP with no dll activates just fine and everyone is happy.

 

image

 

 

 

 

 

 

 

 

 

 

 

12 thoughts on “Sandbox Solutions removed from SharePoint Online–Here’s the fix for your Visual Studio developed WSPs to get them to activate

  1. Nice posting Dave; I’m sure this will save the bacon for a lot of folks who thought we’d get a little warning on this. Thanks!

  2. Dave, did they recently add compiler as a service or something? Would love to follow up!

    1. There is a compiler as a service used by vs2015 that was previously known as Roslyn but the real future lies in typescript and the SharePoint framework that will be coming out later this year. WebAPIs in the azure app service and clients in typescript which compiles to JavaScript compatible with the ECMAScript version of your choice or native clients in Win10 universal or Xamarin. Changing faster than ever but much fun to be had for developers. If you want to avoid the code, powerapps and flow will be killer by the end of the year!

  3. Thanks for sharing Dave looks like that was a head ache for a while

  4. Although manually updating the WSP works, you don’t want to keep doing that after each new build. As we frequently push out new versions of our PDF Conversion Workflow Actions for SharePoint Online, we are (now) suppressing this DLL at the Visual Studio Project level.

    Visual Studio doesn’t make this facility very discoverable, but you can exclude the DLL in your .csproj file

    False

    I hope this helps someone.

  5. Re-post as it looks like this Blog suppresses XML in comments, so I have XML encoded it below. I hope it comes through.

    —–

    Although manually updating the WSP works, you don’t want to keep doing that after each new build. As we frequently push out new versions of our PDF Conversion Workflow Actions for SharePoint Online, we are (now) suppressing this DLL at the Visual Studio Project level.

    Visual Studio doesn’t make this facility very discoverable, but you can exclude the DLL in your .csproj file

    <IncludeAssemblyInPackage>False</IncludeAssemblyInPackage>

    I hope this helps someone.

    1. There’s a post from Microsoft I liked to as well where this is exposed in project properties as well. Thanks for the great comment

Comments are closed.