Closed vsfeedback closed 3 years ago
Thanks 🙂 Original error report was by me.
Cannot reproduce I believe this was already fixed
@jmarolf Can still recreate this one. Recreation is pretty simple, have your editor config in a parent folder to the solution, and included in the solution.
Example: Repo Root .editorconfig Solution1 Solution1.sln Solution2 Solution2.sln
This will apply to both solutions, and is supported. However the editor will blow up when trying to edit it.
Moving it into the solution folder with the exact same content makes the error go away.
This is problematic for mono-repo's with consistent coding standards.
An error occurred while initializing the frame's content
System.ArgumentNullException: Value cannot be null.
Parameter name: path
at System.IO.DirectoryInfo..ctor(String path)
at Microsoft.CodeAnalysis.Editor.EditorConfigSettings.Extensions.SolutionExtensions.<>c.<GetProjectsForPath>b__0_1(Project p)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at Microsoft.CodeAnalysis.Editor.EditorConfigSettings.Extensions.SolutionExtensions.GetProjectsForPath(Solution solution, String givenPath)
at Microsoft.CodeAnalysis.Editor.EditorConfigSettings.DataProvider.SettingsProviderBase`4.Update()
at Microsoft.CodeAnalysis.Editor.EditorConfigSettings.DataProvider.Formatting.CommonFormattingSettingsProviderFactory.GetForFile(String filePath)
at Microsoft.CodeAnalysis.Editor.EditorConfigSettings.DataProvider.CombinedOptionsProviderFactory`1.GetForFile(String filePath)
at Microsoft.CodeAnalysis.Editor.EditorConfigSettings.SettingsAggregator.GetSettingsProvider[TData](String fileName)
at Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.SettingsEditorPane.<Initialize>g__GetFormattingView|12_0()
at Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.SettingsEditorPane.Initialize()
at Microsoft.VisualStudio.Shell.WindowPane.InternalSetSite(IServiceProvider p)
at Microsoft.VisualStudio.Platform.WindowManagement.UIElementDocumentObject.SetSite(DocumentObjectSite site)
at Microsoft.VisualStudio.Platform.WindowManagement.DocumentObjectSite.InitializeDocumentObject(Object punkView)
at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.InitializeDocumentSite(Boolean creatingStubFrame, Boolean replacingStubView, Object punkView, Object punkData, IServiceProvider pServiceProvider, IVsUIHierarchy pUIHierarchy, UInt32 vsid)
at Microsoft.VisualStudio.Platform.WindowManagement.WindowManagerService.CreateContentPane(FrameMoniker frameMoniker, Boolean isDocument, String lpstrMkDoc, UInt32 eCreateWindowFlags, Object punkView, Object punkData, IServiceProvider pServiceProvider, IVsUIHierarchy pUIHierarchy, UInt32 vsid, Guid rguidCmdUI, ViewGroup parent, IVsWindowFrame& ppWindowFrame)
thanks! let me try.
Confirmed this does not reproduce on the latest builds
Latest stable: 17.0.4
Microsoft Visual Studio Community 2022 (64-bit)
An error occurred while initializing the frame's content
System.ArgumentNullException: Value cannot be null.
Parameter name: path
at System.IO.DirectoryInfo..ctor(String path)
at Microsoft.CodeAnalysis.Editor.EditorConfigSettings.Extensions.SolutionExtensions.<>c.<GetProjectsForPath>b__0_1(Project p)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at Microsoft.CodeAnalysis.Editor.EditorConfigSettings.Extensions.SolutionExtensions.GetProjectsForPath(Solution solution, String givenPath)
at Microsoft.CodeAnalysis.Editor.EditorConfigSettings.DataProvider.SettingsProviderBase`4.Update()
at Microsoft.CodeAnalysis.Editor.EditorConfigSettings.DataProvider.Whitespace.CommonWhitespaceSettingsProviderFactory.GetForFile(String filePath)
at Microsoft.CodeAnalysis.Editor.EditorConfigSettings.DataProvider.CombinedOptionsProviderFactory`1.GetForFile(String filePath)
at Microsoft.CodeAnalysis.Editor.EditorConfigSettings.SettingsAggregator.GetSettingsProvider[TData](String fileName)
at Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.SettingsEditorPane.<>c__DisplayClass12_0.<Initialize>g__GetWhitespaceView|1()
at Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.SettingsEditorPane.Initialize()
at Microsoft.VisualStudio.Shell.WindowPane.InternalSetSite(IServiceProvider p)
at Microsoft.VisualStudio.Platform.WindowManagement.UIElementDocumentObject.SetSite(DocumentObjectSite site)
at Microsoft.VisualStudio.Platform.WindowManagement.DocumentObjectSite.InitializeDocumentObject(Object punkView)
at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.InitializeDocumentSite(Boolean creatingStubFrame, Boolean replacingStubView, Object punkView, Object punkData, IServiceProvider pServiceProvider, IVsUIHierarchy pUIHierarchy, UInt32 vsid)
at Microsoft.VisualStudio.Platform.WindowManagement.WindowManagerService.CreateContentPane(FrameMoniker frameMoniker, Boolean isDocument, String lpstrMkDoc, UInt32 eCreateWindowFlags, Object punkView, Object punkData, IServiceProvider pServiceProvider, IVsUIHierarchy pUIHierarchy, UInt32 vsid, Guid rguidCmdUI, ViewGroup parent, IVsWindowFrame& ppWindowFrame)
Solution is in: C:\Projects\syska\project
It's in a solutuin folder called: .rules
...
The file is located here: C:\Projects\syska\project\src\.editorconfig
...
why this is closed without solution, I have the same issue with 17.0.4
why this is closed without solution, I have the same issue with 17.0.4
I really have no idea ... it also fails on 17.0.5
... so if any MS people are listening here. Please reach out if you need more information about the issue.
@jmarolf, Should this be reopened? Seems people are still having this issue (although it's been fixed for me 🙂).
Same here, restart of vs helps....
Thanks folks, sorry that this is still happening. I did get another hit on this callstack that I am investigating. I am tracking that in a new issue here: https://github.com/dotnet/roslyn/issues/58732. If you have any more information to add please put it over there.
Thanks folks, sorry that this is still happening. I did get another hit on this callstack that I am investigating. I am tracking that in a new issue here: #58732. If you have any more information to add please put it over there.
I can't really figure WHY ... because if I start moving the file around and add it again. Sometimes it starts to work.
So then I think it might be a User Context issue ... but having no knowledge of how VS works ... I not sure what to try. But better exception message about what exactly is missing or can't be found would be good.
I will update the other issues if I find anything new.
I get it as well (Visual Studio Community (64-bit v17.0.2) in a .NET Framework solution (MVC - v4.7.2). I left click the project so it is highlighted, right click the project, select "Add" > "New Item" and then I searched for EditorConfig. I get 2 options (.NET) and (default). I select .NET. The file name is ".editorconfig". When I click the "Add" button, I get a popup window titled "Microsoft Visual Studio" with a red cross on the left, and a message "Value cannot be null. Parameter name: path" with a single "OK" button.
This seems to occur anywhere I try to create a file of this type (any folder), and happens with both types of EditorConfig file (.NET and default).
Strangely, the file still gets created.
Also if i try to open the file, it throws the same exception. Here's the stacktrace message
error occurred while initializing the frame's content
System.ArgumentNullException: Value cannot be null.
Parameter name: path
at System.IO.DirectoryInfo..ctor(String path)
at Microsoft.CodeAnalysis.Editor.EditorConfigSettings.Extensions.SolutionExtensions.<>c.
File Path:
Taking a look the fix for this is in 17.1 which has not been released yet. You can install the preview to get it early
This issue has been moved from a ticket on Developer Community.
[severity:It bothers me. A fix would be nice] When trying to open a .editorconfig file in one of my projects, I received a System.ArgumentNullException exception:
Original Comments
Feedback Bot on 5/28/2021, 04:05 AM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Feedback Bot on 5/28/2021, 10:38 PM:
Thank you for sharing your feedback! Our teams prioritize action on product issues with broad customer impact. See details at: https://docs.microsoft.com/en-us/visualstudio/ide/report-a-problem?view=vs-2019#faq. In case you need answers to common questions or need assisted support, be sure to use https://visualstudio.microsoft.com/vs/support/. We’ll keep you posted on any updates to this feedback.
Original Solutions
(no solutions)