Unable to deploy custom files to Style library in SharePoint 2013
-
11-12-2020 - |
Question
I need to deploy the custom files like (CSS,js,images) into Style Library folder in SharePoint 2013 by using Visual Studio.
I created a module and edited the element.xml as
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="Style Library" Url="Style Library">
<File Path="Style Library\Sample.txt" Url="Style Library/Sample.txt" />
</Module>
</Elements>
This is not working.
Solution
Try this:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="Style Library" Url="Style Library">
<File Path="Style Library\Sample.txt" Url="Sample.txt" Type="GhostableInLibrary"/>
</Module>
</Elements>
I think the path of URL needs to be without the path of the module. I am missing also the type.
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange