❔ Help with possible conflicts between different versions of a package
Rider 2022.2 It says it can't resolve the symbols
IServiceCollection
and IConfiguration
despite using clauses being in place for them. The using are greyed out because the 'editor' thinks they're not used, and not because they are invalid (edited)
If I click the little red lightbulb on the line where the types are red, I get the option "reference assembly Microsoft.Extensions.DependencyInjection.Abstractions
and import Microsoft.Extensions.DependencyInjection.IServiceCollection
"9 Replies
If I Ctrl+Click on the
DependencyInjection
napespace as you do for go to definition
, I see a list titled 'Modules' and it looks like it contains every module that namespace is referenced inI Don't know rider, but seems like you need to add the dependency on the nuget package, however you do that
'reference assembly' sounds different
You're not using net Framework, are you?
I'm using .NET 6. When I select that reference and input prompt, the red type name appears green for about 2 seconds, as if an assembly reference was added and then quickly removed again
Sometimes restarting Rider fixes this issue. Especially if u change the build configuration or change the runtime
Aw shit man, thanks. I've been at this too long, my brain is going on strike and I never even considered restarting Rider. That didn't work but it kinda lead me to an answer.
The namespaces are not matched to the filesystem directories, so while one namespace looked like it was present, the solution was actually missing a whole project
I actually had this issue before where only restarting the Rider fixed the issue.
Next time try to build the solution from command line (
dotnet build
) and if that works Rider has an issue. If not u have an actual issue in your code :DAlso use git clean to get rid of 'ghost' dirs that can occur through various branch changes
In the beginning there was one project that was missing, so I added existing project to solution, but that created a duplicate project reference in the solution file and that seemed to confuse the crap out of Rider
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.