-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Solution.AddAdditionalDocument does not add a new file with AdditionalFiles item type #4655
Comments
@vweijsters, can you clarify what your scenario is? What type of file is the file you're trying to add? I ask only because there's a few other bugs floating around in this area that might fix your underlying need and I'd like to confirm. |
I'm adding a default JSON settings file that will (in the future) be parsed by analyzers as means of configuration. The important part for me is that the added file will show up in the A first version of the code is available DotNetAnalyzers/StyleCopAnalyzers#1250 |
👍 |
@vweijsters: thanks. In your case, the settings file name is always known, right? It's always stylecop.json? |
@jasonmalinowski That's correct. It opens some possibilities regarding the inclusion of a .targets file in our NuGet package, but I was trying to avoid that. |
@jasonmalinowski in my case I am adding a JSON file with a different name and still expect it to be an "AdditionalFile". I am adding it in a non-PCL project but want to read it in an Analyzer/Diagnostic using the Projects AdditionalFiles method which right now returns Nothing unless I hand edit the project file. |
"Projects AdditionFiles method" above should read "AnalyzerOptions.AdditionalFiles collection". Can't correct on phone. |
I'm encountering this as well (same scenario as @vweijsters). Any updates? |
No updates, sorry. |
@twsouthwick Take a look at how we are now handling this in DotNetAnalyzers/StyleCopAnalyzers#1790. Obviously it's not ideal, but it's enough to make sure that users aren't left with completely broken functionality 😄 |
Thanks @sharwell . We're already doing something similar to that. I was trying to add a codefix that would add a default config file so the VSIX version could be useful without requiring the user to open up the proj file. |
Rather than try to change the nupkg so that |
The workaround of this issue for what I am understanding (the above mentioned), depends on knowing the file name from the beginning. Has someone found another way? I guess this is low in the priority list. |
I'm blocked on this too. I can't just update via NuGet tools because the path needs to be customized to the individual repository. |
Any news from this? Really would like to add style cop to project |
Any updates on this one? |
This was started back in 2015 and it's still not closed? What is the progress of this item? |
Any progress or update? |
Bumped into the same issue. Any news on that? |
Just to add a note, I thought I was running into this issue too but it turns out stylecop.json was in my .gitignore so it didn't get read by visual studio. |
5 years passed, any updates? This issue is critical if you want to add your own configuration files from the Roslyn-based extension. |
The same issue. Do you have any updates on this? |
Just a friendly reminder that this is still an issue, unfixed. Could you please fix it? |
@GarretWayne this is in the backlog currently. If you are interested in fixing it though we would certainly take a community contribution. Thanks! |
The published workaround doesn't mention Visual Studio 2022. I think the name of the choice has changed to "C# Analyzer Additional File" in that release. |
Can you add the "up for grabs" tag, please? |
Unfortunately, I'm unable to apply labels to this conversation. :( |
@GarretWayne You're always welcome to contribute. I'll add the tag as well, but it's not a requirement for that. |
When adding a new file to a solution from within a codefix provider using the
Solution.AddAdditionalDocument
method, the file gets added with an item type ofNone
where an item type ofAdditionalFiles
is expected.This issue was observed using VS2015 RTM with roslyn 1.0.0
The text was updated successfully, but these errors were encountered: