How can I deploy SandBox Solution from Visual Studio with images on the Server ?

When I trying to deploy it, I am getting the following errors.

1). The Project Item "Images" cannot be deployed through a Package in a Sandboxed Solution.

2). The deployment type "TemplateFile" of file "myImage.jpg" in Project Item "Images" is not compatible with a Package in a Sandboxed Solution.

Please help me to deploy it.

1 Answer 1


You can't deploy anything to any mapped folders in Sandboxed solutions.

A Sandboxed solution cannot place physical files in the LAYOUTS virtual directory - it's just one of their limitations.

What you'll need to do is to add your images to a Module SPI folder in Visual Studio, and have the Solution deploy the module (and the files contained within) to a Document Library in the target site collection.

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.