0

I am trying to deploy a .ASPX file using a module in Visual Studio. In all of the examples I have seen the files to be deployed are stored within the module folder in the Visual Studio project.

My .ASPX file is stored in the Layouts folder in the project and should be deployed to a sub-folder within the layouts folder when deployed.

The Elements.xml file looks as follows but the file paths are wrong in it. There seems to be no way in Visual Studio to find the relative path to the ASPX file in the layout folder within the project structure so that I can put it into the Elements.xml file.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="AICreateNewItem">
<File Path="Layouts\SOMEFOLDER\aicreatenewitem.aspx" Url="Layouts\SOMEFOLDER\aicreatenewitem.aspx" />
  </Module>
</Elements>

Finding Path To ASPX

How can I get the correct file path into the Elements.xml easily in Visual Studio?

2

Modules are used to deploy files to SharePoint Content Database. They can't deploy a file to physical folder. When you add a mapped folder like layouts to SharePoint VS Projects, the files inside the mapped folder automatically get deployed to physical path.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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