madskristensen / FileNesting

Nest files in Solution Explorer
Other
119 stars 59 forks source link

Unable to perform nesting of TS/js/map files in a jsproj #17

Closed Justin-Credible closed 10 years ago

Justin-Credible commented 10 years ago

The plugin doesn't seem to be working for jsproj projects (specifically we are using the Multi-Device Hybrid App template with TypeScript, but the same problem exists with The built-in JavaScript "Blank App (Windows)" project template).

In our other csproj with Automatic Nesting enabled, once we include the js and map file in the solution for a given ts file, it will automatically nest properly. In a jsproj file the automatic nesting does not occur, and we are unable to perform manual nesting either. Instead we receive the following error message.

System.ArgumentNullException: Value cannot be null.
Parameter name: path

(See below for full stack trace)

Steps to reproduce:

  1. Install the MDHA CPT1 from: http://msdn.microsoft.com/en-us/library/dn722381.aspx
  2. Start VS and choose File > New Project
  3. Select Installed > Templates > TypeScript > Multi-Device Hybrid app from the side tree
  4. Select "Blank App (Apache Cordova)" from the right list.
  5. Enter a path and solution name etc and click OK.
  6. Enable TypeScript compile on save for the solution by right clicking the project in the solution explorer and selecting properties.
  7. Locate scripts/index.ts in the solution explorer and open it and then save it (this will generate the JS and MAP files, you may have to adjust the solution explorer to show all files).
  8. Ensure that File Nesting has its "Enable Automatic Nesting" option selected by right clicking any file and navigating to File Nesting.
  9. Select both the JS and MAP files, right click them and select "Include in Project"
  10. See that the files were not automatically nested underneath the ts file (this works in a csproj)
  11. Select just the index.js file and right click and choose File Nesting > Nest Item
  12. Select the index.ts file and click ok
  13. Sometimes this hangs for a while, but eventually you'll get the error below:
The project system has encountered an error.
Value cannot be null.
Parameter name: path

A diagnostic log has been written to the following location: "C:\Users\Justin\AppData\Local\Temp\VsProjectFault_76ecdc4f-5636-4e78-8bef-5f8e6abeb1d2.failure.txt".

Full Stack Trace:

=====================
5/20/2014 7:44:20 AM
Recoverable
System.ArgumentNullException: Value cannot be null.
Parameter name: path
   at Microsoft.Requires.NotNull[T](T value, String parameterName)
   at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode.NodeFromPath(String path)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode.<AddItemWithSpecificAsync>d__2a4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode.<>c__DisplayClasse3.<<AddItem>b__e2>d__e5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
   at Microsoft.VisualStudio.Threading.JoinableTask`1.CompleteOnCurrentThread()
   at Microsoft.VisualStudio.ProjectSystem.ThreadHandlingMultithreaded.ExecuteSynchronously[T](Func`1 asyncAction)
   at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode.<>c__DisplayClass201.<HrInvoke>b__200()
   at Microsoft.VisualStudio.ProjectSystem.Utilities.HResult.Invoke(Func`1 action, IServiceProvider vsShellServiceProvider, IProjectFaultHandlerService projectFaultHandlerService)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.ProjectSystem.Utilities.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass5.<SubmitErrorReport>b__3()
   at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2.<Guard>b__0()
   at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )
===================
5/20/2014 7:45:34 AM
Recoverable
System.ArgumentNullException: Value cannot be null.
Parameter name: path
   at Microsoft.Requires.NotNull[T](T value, String parameterName)
   at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode.NodeFromPath(String path)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode.<AddItemWithSpecificAsync>d__2a4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode.<>c__DisplayClasse3.<<AddItem>b__e2>d__e5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
   at Microsoft.VisualStudio.Threading.JoinableTask`1.CompleteOnCurrentThread()
   at Microsoft.VisualStudio.ProjectSystem.ThreadHandlingMultithreaded.ExecuteSynchronously[T](Func`1 asyncAction)
   at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode.<>c__DisplayClass201.<HrInvoke>b__200()
   at Microsoft.VisualStudio.ProjectSystem.Utilities.HResult.Invoke(Func`1 action, IServiceProvider vsShellServiceProvider, IProjectFaultHandlerService projectFaultHandlerService)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.ProjectSystem.Utilities.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass5.<SubmitErrorReport>b__3()
   at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2.<Guard>b__0()
   at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )
===================
madskristensen commented 10 years ago

This has been fixed. However, jsproj doesn't support nesting through regular VS APIs.