Closed RudeySH closed 3 years ago
Could you upload a sample project on which this error can be reproduced on GitHub?
I created a new project using the built-in "Class Library (.NET Framework)" Visual Studio template. This uses .NET Framework 4.8 and the legacy project system. (As you already noted, #3 might be related.) Then I added a Template.nt
using the first example from the readme. Lastly I added a dummy ClassModel.cs
.
https://github.com/RudeySH/NTypewriterSampleClassLibrary
This gives me a different exception than before:
System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) at EnvDTE.Properties.Item(Object index) at NTypewriter.EditorForVisualStudio.Editor.SolutionItemsManager.GetId(ProjectItem item) at NTypewriter.EditorForVisualStudio.Editor.SolutionItemsManager.<>cDisplayClass9_0.
b1(ProjectItem x) at System.Linq.Enumerable.WhereEnumerableIterator 11.MoveNext()1.MoveNext() at System.Collections.Generic.List
1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable
1 source) at NTypewriter.EditorForVisualStudio.Editor.SolutionItemsManager.GetAssociatedProjectItems(String projectFilePath, String id) at NTypewriter.EditorForVisualStudio.Editor.SolutionItemsManager..ctor(DTE2 dte, String templateFilePath, String projectFilePath) at NTypewriter.EditorForVisualStudio.NTypewriterEditorForVisualStudioPackage.<>cDisplayClass11_0.b__2() at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- 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 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at NTypewriter.EditorForVisualStudio.NTypewriterEditorForVisualStudioPackage. d
Removing ClassModel.cs
gives me a different exception, much more similar to the original exception I had, but not quite the same:
System.InvalidOperationException: Sequence contains no elements at System.Linq.Enumerable.Max(IEnumerable`1 source) at NTypewriter.EditorForVisualStudio.NTypewriterEditorForVisualStudioPackage.
d__11.MoveNext()
Second and third exceptions are corrected in v0.0.3, but I am still not able to reproduce the first one.
Now that the other exceptions are fixed, I was able to reproduce the original exception in a new project. Adding a solution folder causes the exception. I have updated the sample repository: https://github.com/RudeySH/NTypewriterSampleClassLibrary
Fixed in v0.0.4
Thanks! I noticed no new commits in this repository, is the NTypewriter extension not part of this codebase?
Indeed, NTypewriter editor for Visual Studio has a separate private repository. It is not ready to go public.
Thanks for creating NTypewriter! I'm currently attempting to replace Typewriter with something else, this project looks very promising.
Currently, NTypewriter appears to be working for me (it generates files), but after rendering the example template from the readme in my project, Visual Studio's status bar says "Rendering failed" and the following exception/stacktrace is logged: