Web Analytics
Skip to main content

Andosi - Blog

Where we discuss The Art of Great System Design

Resolving "Error occurred in deployment step 'Activate Features': Invalid file name"

Lance Russell

07 June 2011

The other day I was working on a SharePoint project that required the deployment of a Content Type, a List Template, a couple of List Instances and a couple of Feature Receivers. Things were coming along well until I started to reorganize the project. I dragged the List Instances into the List Template folder and renamed several folders to better represent their purposes. When I went to deploy, I got the error: "Error occurred in deployment step 'Activate Features': Invalid file name".

 
I looked around the .spdata files, checked the Feature file and double-checked them all again. Everything looked right. The ULS Logger wasn't much help but it did give me the actual exception: "Exception: Microsoft.SharePoint.SPException: Invalid file name. The file name you specified could not be used. It may be the name of an existing file or directory, or you may not have permission to access the file"
 
Still not much help. I removed all the items from the feature and was able to deploy successfully. Unfortunately, a feature that doesn't do anything isn't much good so I started adding items and deploying one at a time. Feature Receivers: Check. Content Type: Check. List Template: Check. List Instance: Failed.
 
After looking at the List Instance for a while and not seeing the problem, I deleted the Instance from the project and recreated it from scratch. I added it to the feature, deployed and it failed again.
 
I went through the List Template again and saw the familiar warning:
xmlversion="1.0"encoding="utf-8"?>
xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Do not change the value of the Name attribute below. 
If it does not match the folder name of the List Definition project item, 
an error will occur when the project is run. -->

        Name="OldFolderName"
        Type="10001"
I had renamed the List Template folder from within Visual Studio but it did not update the ListTemplate Name element.
 
After correcting the Name to match the new folder name everything worked and the world was right again.
 
Add Solution:
Found 1 deployment conflict(s). Resolving conflicts ...
Deleted list instance 'Lists/SomeAwesomeList' from server.
Adding solution 'SomeAwesomeSolution.wsp'...
Deploying solution 'SomeAwesomeSolution.wsp'...
Activate Features:
Activating feature 'SomeAwesomeFeature' ...
Run Post-Deployment Command:
Skipping deployment step because a post-deployment command is not specified.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========
 
This blog has been relocated from http://mbsguru.blogspot.com/ with authorization.

More Blog Posts


Record Lock Trace v 2.0

Michael Johnson
I've updated the Lock Trace Utility for Dynamics GP with 2 new features. The first enhancement will replace the standard "This batch is being edited by another user" prompt when attempting to post or delete a SOP Batch with the name of the user th...

The Dynamics GP Blogster: Microsoft Dynamics GP 2010 R2 is hot off the press...

Bryan Prince
The Dynamics GP Blogster: Microsoft Dynamics GP 2010 R2 is hot off the press...: "Microsoft has made GP 2010 R2 available prior to the original launch date of May 1, 2011. The product can be downloaded from CustomerSource ..." This blog has been ...