Logo 
Search:

Sharepoint 2010 Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint 2010       RSS Feeds

Deploying Custom Files with Feature

  Asked By: Nisha    Date: Dec 21    Category: Sharepoint 2010    Views: 2551

I need help with this. I am developing a Feature Receiver in VS
2010 on SPS 2010. As part of the feature deployment, I want to deploy a
custom xml file in the same location as that of the feature. I am not able
to figure out where should I place this file in my VS folder structure, so
that this also gets deployed along with the feature itself. I keep getting
an error saying "Error occurred in deployment step 'Add solution', cannot
find the file in 'directory\custom.xml' specified in manifest.xml". May be I
don't know where and how this file should be placed and referenced. Please
help me. I tried several attempts with no luck. Also, I would like to know,
how to control the feature and package directories, the folder structure of
feature and package and so on, while using VS 2010. It seems, VS 2010
doesn't allow much control to us. Any thoughts? Please help.

Share: 

 

6 Answers Found

 
Answer #1    Answered By: Kartik Athani     Answered On: Dec 21

Could you kindly let me know, as to where do i set the
properties of the custom xml file( like DeploymentType and so on) Will it be
in the SharePointProjectItem.spdata file of the project. Unfortunately, I
don't have one by default, because, I started off with an Empty SharePoint
Project template and yes, as you said, I also don't have an elements.xml
file, as I am developing a Feature Receiver. Please help.

 
Answer #2    Answered By: Tyra Hewitt     Answered On: Dec 21

Just right click on the file in solution explorer and select properties from the
context menu. You should see a properties window for the file open below the
Solution Explorer window. You can set the properties there. If you don't see
the properties window you can open it from the View menu. I think its under
Other windows.

 
Answer #3    Answered By: Yessenia Dejesus     Answered On: Dec 21

But I believe,the properties which
you are talking about, appear only for mapped folder items and not for any
externally added file. So, I created a mapped folder for Features and then I
moved this file inside that folder. When I opened the properties of the
file, I saw the DeploymentType as TemplateFile. I couldn't change it, as it
is grayed out. Kindly help. Sorry for pestering you again.

 
Answer #4    Answered By: Nikunj Kansagara     Answered On: Dec 21

That's why I said you needed to add an empty element item to the project and
add the file to the folder added for the elements.xml file of the empty
element. A mapped folder will always go to a particular location inside the
14 hive, and not to the Features folder. If you were deploying any kind of
feature other than a Feature receiver only it would already have an elements
file and folder.

 
Didn't find what you were looking for? Find more on Deploying Custom Files with Feature Or get search suggestion and latest updates.




Tagged: