2

I create Blank Express Application in Visual Studio 2013. After it installs npm modules I run it. it works well with no errors. But if I close solution and than open it again project load failes and I see errors in output window saying "The specified path, file name, or both are too long. The fully qualified file name must be less than 260". What should I do fix it?

Update: csproj file

    <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
    <Name>ExpressApp7</Name>
    <RootNamespace>ExpressApp7</RootNamespace>
  </PropertyGroup>
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>83aac9f6-1094-40fc-8ce9-2ca0fe8ccbac</ProjectGuid>
    <ProjectHome>.</ProjectHome>
    <StartupFile>app.js</StartupFile>
    <SearchPath>
    </SearchPath>
    <WorkingDirectory>.</WorkingDirectory>
    <OutputPath>.</OutputPath>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <ProjectTypeGuids>{3AF33F2E-1136-4D97-BBB7-1795711AC8B8};{349c5851-65df-11da-9384-00065b846f21};{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}</ProjectTypeGuids>
    <ProjectView>ProjectFiles</ProjectView>
    <NodejsPort>1337</NodejsPort>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
    <DebugSymbols>true</DebugSymbols>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
    <DebugSymbols>true</DebugSymbols>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="app.js" />
    <Compile Include="routes\index.js" />
    <Compile Include="routes\user.js" />
    <Content Include="package.json" />
    <Content Include="public\stylesheets\style.styl" />
    <Content Include="README.md" />
    <Content Include="views\index.jade" />
    <Content Include="views\layout.jade" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="public\" />
    <Folder Include="public\images\" />
    <Folder Include="public\javascripts\" />
    <Folder Include="public\stylesheets\" />
    <Folder Include="routes\" />
    <Folder Include="views\" />
  </ItemGroup>
  <Import Project="$(VSToolsPath)\Node.js Tools\Microsoft.NodejsTools.targets" />
  <ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
        <WebProjectProperties>
          <UseIIS>False</UseIIS>
          <AutoAssignPort>True</AutoAssignPort>
          <DevelopmentServerPort>0</DevelopmentServerPort>
          <DevelopmentServerVPath>/</DevelopmentServerVPath>
          <IISUrl></IISUrl>
          <NTLMAuthentication>False</NTLMAuthentication>
          <UseCustomServer>True</UseCustomServer>
          <CustomServerUrl></CustomServerUrl>
          <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
        </WebProjectProperties>
      </FlavorProperties>
      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}" User="">
        <WebProjectProperties>
          <StartPageUrl>
          </StartPageUrl>
          <StartAction>CurrentPage</StartAction>
          <AspNetDebugging>True</AspNetDebugging>
          <SilverlightDebugging>False</SilverlightDebugging>
          <NativeDebugging>False</NativeDebugging>
          <SQLDebugging>False</SQLDebugging>
          <ExternalProgram>
          </ExternalProgram>
          <StartExternalURL>
          </StartExternalURL>
          <StartCmdLineArguments>
          </StartCmdLineArguments>
          <StartWorkingDirectory>
          </StartWorkingDirectory>
          <EnableENC>False</EnableENC>
          <AlwaysStartWebServerOnDebug>False</AlwaysStartWebServerOnDebug>
        </WebProjectProperties>
      </FlavorProperties>
    </VisualStudio>
  </ProjectExtensions>
</Project>
Pavel Minaev
  • 99,783
  • 25
  • 219
  • 289
Clansman
  • 21
  • 2
  • 3
  • 1
    http://stackoverflow.com/questions/2054625/visual-studio-2008-references-too-long?rq=1 – mainguy Feb 10 '14 at 15:00
  • That answer suggests to find all '..\..\' occurencies in the .csproj file. I don't have any. I think this problem is somehow related to npm modules that were automatically loaded to the project – Clansman Feb 10 '14 at 19:47
  • You dont have a csproj file or no relative paths? If you look at all the related questions on the right side it should be clear that this error comes from VS and your projectfile. But i'm just guessing here since I cant see your files... – mainguy Feb 10 '14 at 20:52
  • no '..\..\' string in relative paths – Clansman Feb 10 '14 at 21:26
  • Also could be related to path variables. Best is you show us your projectfile. – mainguy Feb 11 '14 at 10:47
  • I added a csproj file content/ – Clansman Feb 11 '14 at 20:16
  • I've had a very similar problem, both the working and reloading not working. I found that if I move the node_modules folder out then I can open the solution again, of course that's not too helpful. Have you got anywhere with this since? – iss42 Mar 26 '14 at 19:21
  • This is definitely a more acute problem when working with node.js than it is with C#, simply because using npm creates those deeply nested hierarchies that then break the build. Please see my answer to this question for some workarounds that you can try: http://stackoverflow.com/questions/23351294/file-path-character-limit-error-in-windows-and-node-app – Pavel Minaev May 15 '14 at 02:57

1 Answers1

0

There are several path variables in your file which are concatenated to your actual paths. For example: $(VSToolsPath), $(MSBuildExtensionsPath32), $(MSBuildExtensionsPath)

Also you have realtive paths (which are hard to recognise as paths) like this one:

<WorkingDirectory>.</WorkingDirectory>

I bet your issue comes from here (line 49):

<Import Project="$(VSToolsPath)\Node.js Tools\Microsoft.NodejsTools.targets" />

So check the default paths in VisulaStudio Settings, the custom paths in your project settings and try to move everythin to lower directory level.

mainguy
  • 8,283
  • 2
  • 31
  • 40