SharePoint 2010, Visual Studio 2010, Packaging a solution - The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

Hi,
I have a solution that used to contain one SharePoint 2010 project. The project is named along the following lines:
<Company>.<Product>.SharePoint - let's call it Project1 for future reference. It contains a number of features which have been named according
to their purpose, some are reasonably long and the paths fairly deep. As far as I am concerned we are using sensible namespaces and these reflect our company policy of "doing things properly".
I first encountered the following error message when packaging the aforementioned SharePoint project into a wsp:
"The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters."
I went through a great deal of pain in trying to rename the project, shorten feature names and namespaces etc... until I got it working. I then went about gradually
renaming everything until eventually I had what I started with, and it all worked. So I was none the wiser...not ideal, but I needed to get on and had tight delivery timelines.
Recently we wanted to add another SharePoint project so that we could move some of our core functinality out into a separate SharePoint solution - e.g. custom workflow
error logging. So we created another project in Visual Studio called:
<Company>.<Product>.SharePoint.<Subsystem> - let's call it Project2 for future reference
And this is when the error has come back and bitten me! The scenario is now as follows:
1. project1 packages and deploys successfully with long feature names and deep paths.
2. project2 does not package and has no features in it at all. The project2 name is 13 characters longer than project1
I am convinced this is a bug with Visual Studio and/or the Package MSBuild target. Why? Let me explain my findings so far:
1. By doing the following I can get project2 to package
In Visual Studio 2010 show all files of project2, delete the obj, bin, pkg, pkgobj folders.
Clean the solution
Shut down Visual Studio 2010
Open Visual Studio 2010
Rebuild the solution
Package the project2
et voila the package is generated!
This demonstrates that the package error message is in fact inaccurate and that it can create the package, it just needs a little help, since Visual Studio seems to
no longer be hanging onto something.
Clearly this is fine for a small time project, but try doing this in an environment where we use Continuous Integration, Unit Testing and automatic deployment of SharePoint
solutions on a Build Server using automated builds.
2. I have created another project3 which has a ludicrously long name, this packages fine and also has no features contained within it.
3. I have looked at the length of the path under the pkg folder for project1 and it is large in comparison to the one that is generated for project2, that is when it
does successfully package using the method outlined in 1. above. This is strange since project1 packages and project2 does not.
4. If I attempt to add project2 to my command line build using MSBuild then it fails to package and when I then open up Visual Studio and attempt to package project2
from the Visual Studio UI then it fails with the path too long error message, until I go through the steps outlined in 1. above to get it to package.
5. DebugView shows nothing useful during the build and packaging of the project.
6. The error seems to occur in
CreateSharePointProjectService target called at line 365 of
Microsoft.VisualStudio.SharePoint.targetsCurrently I am at a loss to work out why this is happening? My next task is to delete
project2 completely and recreate it and introduce it into my Visual Studio solution.
Microsoft, can you confirm whether this is a known issue and whether others have encountered this issue? Is it resolved in a hotfix?
Anybody else, can you confirm whether you have come up with a solution to this issue? When I mean a solution I mean one that does not mean that I have to rename my namespaces,
project etc... and is actually workable in a meaningful Visual Studio solution.

Hi
Yes, I thought I had fixed this my moving my solution from the usual documents  to
c:\v2010\projectsOverflow\DetailedProjectTimeline
This builds ok, but when I come to package I get the lovely error:
Error 2 The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. C:\VS2010\ProjectsOverflow\DetailedProjectTimeline\VisualDetailedProjectTimelineWebPart\Features\Feature1\Feature1.feature VisualDetailedProjectTimeline
Now, the error seems to be related to 
Can anyone suggest what might be causing this. Probably some path in an XML file somewhere. Here is my prime suspect!
<metaData>
<type name="VisualDetailedProjectTimelineWebPart.VisualProjectTimelineWebPart.VisualProjectTimeline, $SharePoint.Project.AssemblyFullName$" />
<importErrorMessage>$Resources:core,ImportErrorMessage;</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title" type="string">VisualProjectTimelineWebPart</property>
<property name="Description" type="string">My Visual WebPart</property>
</properties>
</data>
</webPart>
</webParts>
.... Unless I can solve this I will have to remove the project and recreate but with simple paths. Tho I will be none the wiser if I come across this again.
Daniel

Similar Messages

  • Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

    Hi, Im trying to get the whole path in my server, so i tried that with this following code
    Get-ChildItem $sourceFolder  -Recurse | ?{$_.PsIsContainer} |Get-Acl
    But then, it showed me somtehing like this :
    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
     I tried to find the solver everywhere and mostly they propose to change the path name, which is impossible, since I am working with my company server, and those folder have already there before i start to work here, then the other ask me to use robocopy,
    but all of the trick just dont work
    is there any way to solve this problem? thanks

    There is no simple solution to this. And it is not a limitation of powershell itself, but of the underlying NTFS file system.
    If the problem is that a folder with a name longer than 248 exists anywhere within your directory structure, you are hooped.
    If the problem is that some fully qualified path names exceed 260 characters, then, in those cases, the solution already given is to create a psdrive partway up the path from the drive letter or server/share root of the path. Unfortunately, the output produced
    will be relative to that psdrive and not to what is specified as the $sourcefolder.
    unless you already know where those problematic paths are, you might consider trying to trap those errors and have your script figure out where it needs to create psdrives. You might then be able to calculate the equivalent path for each file or folder and
    output that. the programming effort would be simpler to just created a psdrive for each folder encountered, however I expect that would be very inefficient.
    Al Dunbar -- remember to 'mark or propose as answer' or 'vote as helpful' as appropriate.

  • TFS Build Error - Exception Message: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters

    I am trying to set-up CI of Orchard CMS and deploy it on Azure using TF service. I am stuck at following error for path being
    longer than 260 characters. However, when counted the total characters in path are 235. Please see the below error :
    Other Errors and Warnings
    1 error(s), 1 warning(s)
    Exception Message: TF400889: The following path contains more than the allowed 259 characters: drop/_PublishedWebsites/Orchard.Web_Package/Archive/Content/C_C/a/src/projects/Orchard/dev/DevAltaf/Orchard/src/Orchard.Web/obj/Debug/Package/PackageTmp/Modules/BrentApart.BannerManager/Scripts/controllers/bannerAssignmentController.js. Specify a shorter path. (type VssServiceException)
    Exception Stack Trace: at Microsoft.TeamFoundation.Build.Workflow.Activities.FileContainerDropProvider.EndCopyDirectory(IAsyncResult result)
    at Microsoft.TeamFoundation.Build.Workflow.Activities.CopyDirectory.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
    at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
    Inner Exception Details:
    Exception Message: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. (type PathTooLongException)
    Did anyone came across such issue while deploying Orchard on Azure with TF service? If yes, how did you sort this freaking error?
    Thanks,
    Altaf B.

    Hi AltafB,
    For your situation, you can short the path for the source code. Or use a short path for build agent folder in your build definition. You can refer to the links below to solve your problem:
    http://blogs.msdn.com/b/aaronhallberg/archive/2007/06/20/team-build-and-260-character-paths.aspx
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/1638a5f0-9321-4ff9-9ee7-6d347badb972/please-some-solution-to-the-specified-path-file-name-or-both-are-too-long?forum=tfsbuild
    Besides, since you deploy Orchard to Azure, you can also publish it directly using publish profile in Visual Stduio or WebMatrix directly.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Powershell Get-childItem: The specified path, file name, or both are too long.

    Hey Scriping Guys!
    I've been using a PowerShell script for a couple of years now to generate a monthly report showing the size of user folders on a number of departmental file servers.  It's working just fine on all file servers except one where the users have gotten carried away with creating sub-folders and using realy long descriptive file names.  The problem piece of script is this:
    $colItems = (Get-ChildItem \\192.168.10.5\marketing -recurse | Measure-Object -property length -sum)
    "marketing-serv\marketing: "+"{0:N2}" -f ($colItems.sum / 1GB) + " GB"
    The reply I get is:
    Get-ChildItem : The specified path, file name, or both are too long. The fully
    qualified file name must be less than 260 characters, and the directory name mu
    st be less than 248 characters.
    At G:\data\Server_space_Report\serverspace2.ps1:37 char:27
    + $colItems = (Get-ChildItem  <<<< \\192.168.10.5\marketing -recurse | Measure-Obje
    ct -property length -sum)
    Yes, the message is correct, however, when I connect to the server, right click the folder and chose properties it returns a size of 128 GB.  My questions are
    1. Why does clicking on folder properties not produce an error (what is it doing differently from my script)?
    2. How can I fix my script?
    Thanks,

    I am trying to clear up the older open posts on this forum. If this is still an unresolved issue for you please let me know. If you do not post back within one week I will assume it is resolved and will close this thread.
    Thank you
    Ed Wilson
    Microsoft Scripting Guy

  • The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

    I've followed
    this blog post, but it didn't work for me. I truly don't want to change my solution path as this is not acceptable. What else can I do?
    I can't believe we still have limits on path length.

    Note that the solution described in the blog post does not change your solution path. The _CSRUN_STATE_DIRECTORY environment variable sets the location of the temporary folders used by the compute emulator. Your solution does not need to move.
    Though, you may still have problems related to path length inside your solution. To resolve these, I have sometimes used symbolic links (using MKLINK /D link target) or substed drives (SUBST X: path) to create shorter paths and then opened the
    solution from there. If I recall correctly, with the first method, you need to be careful how you navigate to the solution in the Open Project dialog. I think that if you browsed to the path, it would still use the long path, so you need to paste the short
    path into the file name text box to go directly to the location of your .sln file. I may be misremembering the details though.
    BTW, I can't believe we still have limits on path length either.

  • Sharepoint 2010 - Visual studio 2010 error - Error occurred in deployment step 'Add Solution': Failed to load receiver assembly

    Hello,
    I get the following error when trying to attach an event reciver ->
    Error occurred in deployment step 'Add Solution': Failed to load receiver assembly . The system cannot find the file specified.
    This happens only when i try to change the deployment target from "GlobalAssemblyCache" to "WebApplication".
    Steps to reproduce->
    1. Create a new feature and add an event receiver. Deploy the solution. Everything works fine.(Since deployment target is GlobalAssemblyCache). If you now change the deployment target to "WebApplication" , it works too.
    2. Now, restart visual studio. Change Deployment target to  "WebApplication" without deploying the solution. And you get the above error.
    3. Every time you restart your visual studio with deployment target as "WebApplication", you will receive this error.
    Any idea?? Manual deployment of the solution works fine too.
    When i go to virutal path bin directory, the dll is missing because of which the error occurs. Dont know why, it doesnt copy the dll to bin?
    Thanks in advance,

    Hi,
    Feature receivers must be deployed in the GAC & cannot be deployed to private bin of the WebApplication.
    Link: http://msdn.microsoft.com/en-us/library/ms469501.aspx 
    HTH !!!
    AnjaliCH-MSFT

  • Deploing a BDC Model project to SharePoint Foundation 2010 usinging Visual Studio 2010

    Hello,
    I am tring to deploy external content type to Sharepoint 2010 foundation using Visual studio 2010 and I followed this:
    http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/04/02/deploy-a-bdc-model-project-to-sharepoint-foundation-2010-using-visual-studio-2010.aspx
    after completing procedure I have tried do deploy solution but I always get this exception:
     Error 1 Error occurred in deployment step 'Add Solution': Access denied by Business Data Connectivity.
        Error was encountered at or just before Line: '0' and Position: '0'.
      0 0 BdcModelProjectTest
    I have tried to grant myself permissions in Sharepoint central administration (
    http://blogs.msdn.com/b/ericwhite/archive/2010/06/11/access-denied-by-business-data-connectivity.aspx ) but when I click ok I get this exception
    No windows identity for damain\username. 0a193cf4-3811-4aa8-a657-0de3b8be3793
    07/04/2011 16:46:46.31  w3wp.exe (0x0828)                        0x1414 Business Connectivity Services Business Data                
     g0k9 High     Access Denied for User '0#.w|damain\username, which may be an impersonation by damain\username
    I am really hopeless, can anyone help?

    Hi,
    It seems that an account are you using to deploy solution doesn't have sufficient permission in the BDC Metadata Store. In order to assign permission you should open Central Administration->Application Management->Manage Service Application->Business
    Data Connectivity Service->Click Set Metada Store Permission on the ribbon->Set Permission you need and tick the checkbox "Propagate permission to all..."
    Dmitry
    Lightning
    Tools Check out our SharePoint tools and web parts

  • Install sharepoint 2010 libraries in visual studio 2010

    hi all,
    I want to develop sharepoint  in visual studio without installing SharePoint!!
    so I can write my code in my laptop which it have not enough memory (for installing SharePoint) with no error and deploy it in the server later.
    because I carry my laptop every where.
    is that can be done??

    Yes, you can with the DLLs. Refer to the following post for more information
    http://stackoverflow.com/questions/12950548/sharepoint-2010-development-without-local-server-installation
    http://geekswithblogs.net/KunaalKapoor/archive/2012/04/26/develop-sharepoint-solutions-without-installing-sharepoint-on-visual-studio.aspx
    Cheers,

  • Visual Studio 2010 and SharePoint Foundation 2010

    From a development perspective, if I have a Windows 2007 Operating System and download Sharepoint Foundation 2010, can I develop web parts using Visual Studio 2010?  Are there other components I need?
    When we convert to SharePoint Server 2013 in production, is there a version of VS that will allow me to remotely access that server? 

    Hi,
    If your server have already installed the SharePoint Foundation 2010, we can develop web parts using Visual Studio 2010/2012/2013.
    If you want to convert to SharePoint Server 2013 in production, you need use Visual Studio 2012/2013 and install Microsoft Office Developer Tools for Visual Studio 2012 which can be found here:
    http://www.microsoft.com/visualstudio/eng/office-dev-tools-for-visual-studio (direct install :
    http://aka.ms/OfficeDevToolsForVS2012).
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Question about creating association between Sharepoint BDC entities using Visual Studio 2010

    I am following this tutorial:
    http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/08/02/walkthrough-of-creating-association-between-sharepoint-bdc-entities-using-visual-studio-2010.aspx
    I am getting the following error:
     There is an error in the TypeDescriptors of Parameters on Method with Name 'CustomerToOrder' on Entity (External Content Type) with Name 'Customer' in Namespace 'BdcAssociationSample.BdcModel1'. The TypeDescriptors incompletely define where the Foreign
    Identifiers of Entity 'Order' in Namespace 'BdcAssociationSample.BdcModel1' are to be read. That Entity expects exactly '1' Identifiers, but only '0' TypeDescriptors with the correct Association were found from which to read them.
    I have viewed the following:
    http://lightningtools.com/business_connectivity_services/the-typedescriptors-incompletely-define-where-the-identifiers-of-entity-x-are-to-be-readbcs-error/
    after reading that article, I am still not sure what setting I am missing.  Does anyone have the full working source code from the msdn article linked above?

    Hi,
    According to your post, my understanding is that you got the symbols not loaded error.
    First try rebuilding your project by right mouse click the project > Rebuild If that doesn't work, try a clean of the project (right mouse click on the project > clean)
    If that didn't work check this:
    Right mouse click your project
    select [Properties]
    select the [Build] tab
    make sure [Define DEBUG constant] and [Define TRACE constant] are checked
    Click the [Advanced] button at the bottom of the Build tabpage
    Make sure that [Debug Info:] is set to [full]
    Click [OK] and rebuild the project ;
    Hope that works for you! (step 6 generates the .pdb files, these are the debugging symbols)
    What’s more, you can clean & re-compile the code, then install the respective dlls one more time to GAC (just remove them before adding to GAC again), do an IISReset to check whether it works.
    More reference:
    http://stackoverflow.com/questions/2155930/fixing-the-breakpoint-will-not-currently-be-hit-no-symbols-have-been-loaded-fo
    http://stackoverflow.com/questions/2301216/the-breakpoint-will-not-currently-be-hit-no-symbols-have-been-loaded-for-this-d
    http://geekswithblogs.net/dbutscher/archive/2007/06/26/113472.aspx
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jason Guo
    TechNet Community Support

  • Able to connect the visual studio 2010 to Remote SharePoint 2010 server?

    Able to connect the visual studio 2010 to Remote SharePoint 2010 server?
    l
    I researched the result value is null,
    They asking to try in another method like
    SharePoint Redistributable,
    SharePoint SDK.
     Any possible ways to connect the remote SharePoint2010 server with the local system.

    hi,
    try to see these links :
    http://platinumdogs.me/2014/01/14/remote-sharepoint-site-connections-not-supported-using-visual-studio-2013-and-host-named-site-collections/
    http://blogs.msdn.com/b/kvosters/archive/2013/03/27/sharepoint-2013-cannot-connect-to-the-targeted-site.aspx
    if you try these and they didn't work so you can't :(
    HOPE IT HELPS

  • Beginning SharePoint 2010 Development with Visual Studio 2010

    I am a beginner with SharePoint 2010 development with Visual studio 2010. Please guide me for some good, practical videos tutorials and books which would help me get started with programming. I need to build some workflow in VS2010 in C#. Please help!

    Hi PinkRuby, 
    There are some good videos on the MSDN site that give a general overview of developing on the SharePoint platform. 
    http://msdn.microsoft.com/en-au/office/dn448488
    Another good resource is PluralSight. You need a paid subscription (though it's not much), but it has lot's of great video content for learning. 
    http://pluralsight.com/training/Courses#sharepoint
    Regards, Matthew
    MCPD | MCITP
    My Blog
    View
    Matthew Yarlett's profile
    See my webpart on the TechNet Gallery that allows administrative users to upload, crop and format user profile photos. Check it out here:
    Upload and Crop User Profile Photos

  • Crystal Report 13 Visual Studio 2010 SQL Server 2008 R2 ODBC Problem

    Hi Everybody,
    I am new in Crystal Report.
    I developed a web application in Visual Studio 2010, and my Database is SQL Server 2008 R2.
    I created reports using Crystal Report 13 in Visual Studio and my Operating System is Windows 7 32-Bit.
    I used ODBC Connection System DNS for my application.
    It is running fine even after Hosting on my local PC.
    But it creates problem when hosted on my Team Leader PC and Test Server.
    Their Configurations are same but only difference is "SQL Server 2008" Not R2
    The Error I am getting is "Failed to open the connection".
    When I Host the same on my another team member PC, I am getting the error like
    "Failed to open the connection. Details: [Database Vendor Code: 4060 ] Database Connector Error: ' [Database Vendor Code: 4060 ]' Failed to open the connection. Failed to open the connection. TestVr {CE268132-D2BD-43EC-BE45-0BCD847FBCDA}.rpt Details: [Database Vendor Code: 4060 ]"
    I tried various solution to fix this bug.
    But i am unable to do this and not getting any idea to fix this issue.
    If anyone can guide I will be thankful to him.
    All suggestions are appreciable.
    Thank you

    Hi,
    Please use the top right search box. for ex below search which will return many useful kb's, articlea and forum threads where simillar issues are discussed.
    [http://www.sdn.sap.com/irj/scn/advancedsearch?query=failedtoopentheconnection|http://www.sdn.sap.com/irj/scn/advancedsearch?query=failedtoopentheconnection]
    Most probably the issue is missing database client driver / provider.
    Install the driver used to connect the rpt to the db on the server and then create a 32 bit DSN with the same name as the dev machine..
    Hope this helps,
    Bhushan.

  • Crystal report for visual studio 2010 data source object is not valid error

    Hello,
    I receive an "data source object is not valid" error when I want to print one CR document after setting an ADODB.Recordset on SetDataSource method of my report.
    On my developer station, this operation works without problem but on client station, I get this error.
    The redistributable package for client is installed on client side (CRRuntime_32bit_13_0_1.msi).
    Can someone help me?
    Thank you.

    Thank's for your answers
    Dim rsPkLst As ADODB.Recordset = Nothing
    Dim report As New crPickingList
    ' Fill ADODB.Recordset with SQL Statment
    If rsPkLst.RecordCount > 0 Then
          report.SetDataSource(rsPkLst) ' Error : The data source object is invalid
    EndIf
    This error appears during  "report.SetDataSource(rsPkLst)" instruction.
    ADODB drivers are already installed and my ADODB.Recordset is filled with good records.
    This project is an updated project from Visual Studio 2003 to Visual studio 2010 and the old version was running fine.
    Developer and client station runs under Windows XP SP3.
    On developer side I install CRforVS_13_0_1 (BuildVersion=13.0.1.220.Cortez_CR4VS).
    On client side I install CRRuntime_32bit_13_0_1.msi.
    Both stations use Microsoft .Net Framework 4.
    Move to ADO.NET is a solution but, for the moment, I do not have the time to change all applications from my company.
    (I get this error from all application updated from VS 2003 to VS 2010 developed since 2005)
    David.

  • How to create a site column through Visual Studio 2010?

    I was trying to create lists, content type and site columns through Visual Studio 2010. But I could not figure out how to add site column? What item do I need to add for this and what kind of coding is to be done?

    Try this
    1. Create a Empty project in Visual studio.
    2.The Empty SharePoint Project template does not include any Features in the Features folder. To add a new Feature to this project, right -click the Features folder, and click Add Feature. This adds a new Feature component to the folder; double – click the
    Feature1 icon in Solution Explorer to modify the Feature ’ s
    metadata using the Feature designer. The Title and Description values appear on the Features pages in Site settings. It is a good idea to make these values
    descriptive so that administrators will know what they are adding to the site when they activate the feature.
    The feature ’ s scope determines where the feature can be activated within SharePoint. Please Note – Certain components, such as site columns, content types, Master pages, and Page Layouts, are installed at the site collection level and made available to all
    sites within the collection. These components require that the scope for the feature be set to “ Site. ”
    3. Next, add a new item to the project (Right – click project name ➪ Add ➪ New Item) and select the Empty Element template from the Add New Item dialog box.
    The Empty Element template is an XML fi le where you can enter CAML Field definitions.
    Following is what you will add in your elements.xml file –
    < Elements xmlns="http://schemas.microsoft.com/sharepoint/" >
    < Field ID="{76C140E1-D827-433B-AD38-257F9594B846}"
    Name="CustomCol"
    DisplayName="My Custom Site Column"
    Group="Custom group"
    Type="Text"
    Required="FALSE"/ >
    < Field ID="{5F516D92-969C-4661-81B9-C9210E2A2FDC}"
    Name="Choice Type"
    DisplayName="My Choice Type"
    Group="Custom group"
    Type="Choice"
    Required="FALSE" >
    < CHOICES >
    < CHOICE > Medical < /CHOICE >
    < CHOICE > Dental < /CHOICE >
    < CHOICE > Vision < /CHOICE >
    < CHOICE > Insurance < /CHOICE >
    < /CHOICES >
    < /Field >
    < /Elements >
    4. To deploy the Site Columns defined in the Elements file, right – click the project name in the Visual Studio Solution Explorer, and select Deploy. This will deploy the solution file to the solution store and activate the Feature in the targeted site collection.

Maybe you are looking for