-
Notifications
You must be signed in to change notification settings - Fork 396
Support file nesting implemented in for dotnet core web projects #3242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Since nearly one year open...to enable something that another Team of your Company has already developed perfectly...can you please copy&paste the Code over and support also library Projects... |
@SharpNoiZy we recently added support for automatic dynamic nesting of files in .NET Core projects (via #4378) which will hopefully improve the situation for your library projects in VS2019. This issue is tracking porting the configurable nesting capability of web projects to non-web projects. The default nesting rules we've added should cover the majority of library project use cases, without the need for configuration. What kinds of files would you expect to be nested in your library projects? |
We use in our hole Company (100 Devs, 5 Teams) CQRS with this Config. {
"help": "https://go.microsoft.com/fwlink/?linkid=866610",
"dependentFileProviders": {
"add": {
"fileSuffixToExtension": {
"add": {
"Request.cs": [ "Command.cs", "Query.cs" ],
"Response.cs": [ "Command.cs", "Query.cs" ]
}
}
}
}
} So, you have: Command, CommandHandler and Response under one element. |
Thank you for the example. It won't be possible to do that automatically for libraries until we add support for custom nesting rules in this project-system. We're aware of the WebToolsExtensions implementation and have looked at porting it, but the amount of work involved is non-trivial and must be considered along with our other priorities. |
I'm probably misunderstanding the issue, but doesn't the configurable file nesting already work with SDK-style class library projects? |
See https://github.com/aspnet/websdk/issues/248#issuecomment-364520896 - just need VS 15.6 or higher, add the capabilities to the csproj file and configure the nesting. We're using this successfully with SDK-style library csprojs (also in a CQRS context, funnily). |
@fschmied thanks for pointing out a workaround. @SharpNoiZy can you try adding the following to your library's project file? <ItemGroup>
<ProjectCapability Include="DynamicDependentFile" />
<ProjectCapability Include="DynamicFileNesting" />
</ItemGroup> You'll need to reload the project, but should then see nesting support. |
@drewnoakes We have this WORKAROUND in place, but it's exactly that. There should be one official solution for all Project types. |
That's what this issue is tracking. |
How to specify the custom nesting profile file in the project file? Want to include the json file along with the project instead of somewhere in user appdata. |
@DiryBoy You can create as the magical name I love this feature and it cleans up our We're currently using the workaround of defining the |
Saint, you're looking at this so I've assigned it to you. Feel free to update/dupe this issue as necessary. |
We will be tracking this as part of #5722 |
@anyone interested in using @NickCraver trick, note that the file at your solution level must be called It also seems that, for non-Web projects, <ItemGroup>
<ProjectCapability Include="DynamicFileNesting"/>
</ItemGroup> |
@odalet I'm trying this same workaround in VS Community 2022 RC3 and it's not working. |
Not working with the latest right now - VS Professional 2022 V17.0.4 |
I don't have any new information since joining (will ask!), but for those it's not working for: do you have the web payload for VS installed? That's where the actual functionality resides and why it only worked on web projects by default (1:1 with needing the workload anyway), at least previously - I'm not sure if anything changed in VS 2022. |
Same problem here. I got it nicely working for VS 2019 but it broke in VS 2022. |
New issue for VS 2022: #7939 |
This is being actively worked on. There are performance implications for us to turn it on by default for all projects. The manual approach in VS2022 changed. I'm sorry there was no update posted here until now. Manually enabling file nesting for non-web projects in VS 2022<ItemGroup>
<ProjectCapability Include="ConfigurableFileNesting" />
<ProjectCapability Include="ConfigurableFileNestingFeatureEnabled" />
</ItemGroup> |
Thank you. I can confirm it works for us. Is there a way for a nuget package to suggest/install nesting rules? We need these: {
"help": "https://go.microsoft.com/fwlink/?linkid=866610",
"dependentFileProviders": {
"add": {
"extensionToExtension": {
"add": {
".t.cs": [
".cs"
],
".t.txt": [
".cs"
],
".Aspect.cs": [
".cs"
],
".Helper.cs": [
".cs"
],
".cs.html": [
".cs"
]
}
}
}
}
} Our use case is a custom test framework. |
Not that I know of, though I am not an expert. Could you open a new issue for this please? |
See this request here: https://github.com/aspnet/websdk/issues/248
Nesting went live in 15.6 Preview 3 and there were requests for other dotnet core projects to support that.
To support nesting, project needs to have following capabilities:
To add default nesting behavior for your project type, a provider needs to be implemented.
Contact me for details when ready.
The text was updated successfully, but these errors were encountered: