Article
0 comment

Remove empty dlls from Sandbox Solutions

On July 29 Microsoft announced that they will completely remove of code-base sandboxed solution support in Office 365.
The main problem is that many of those SharePoint solutions just deploy XML based artifacts but no binary code.
Nevertheless I think many of those sandbox solutions deploy an empty dll to Office 365 especially when they are developed in Visual Studio.
This unwanted dll can be simply avoided directly through the correct configuration of your Visual Studio.

Let’s say I deploy a custom list through a sandbox solution. For that no dll is required. To remove the dll from your WSP File you simply need to select your project. Take a look at the project properties below the solution explorer. There you will find a property named ‘Include Assembly in Package’.
include-assembly-in.package
The default setting is set to ‘True’ and that’s why you will find in every WSP an empty dll, especially when you don’t have any C# code in your project. The same setting applies to Farm and Sandbox Solutions.

Build the WSP without dll

When you build a WPS in Visual Studio you will always get a DLL. Even an empty one. This cannot be avoided.
The property will be used by the packaging process and if you tell Visual Studio that you don’t have a dll, the package will be built without.
To prove that navigates to your bin directory.

Check if dll was removed from WSP

Check if dll was removed from WSP

You will find an empty dll and the WSP there. To make sure that this dll was not packaged in the WSP simply copy and rename the file ending in ‘.cab’. Now you can take a look in your WSP using the file explorer and won’t find any DLL there.

In case you still need to use your sandbox solution to make sure that the solutions really needs the deal. Otherwise, you can remove it and redeploy the updated WSP package. For now it should work as long as you have removed the dll.

To get a complet list of your sandbox solutions in Office 365. Check out New Script Available from Microsoft PnP: Generate list of sandbox solutions from SharePoint Online tenant.

In addition you can use the free Sandbox Solution Inspector released by Rencore. This will analyse all your installed Sandbox Solution on Office 365, gives you great insight and is also capable to remove empty dlls from your solutions.

Leave a Reply

Required fields are marked *.


This site uses Akismet to reduce spam. Learn how your comment data is processed.