So I have been working on a plugin for a few weeks and all was well… then one day (I can’t remember if I updated VS or Unreal… I think both) I started getting errors. A lot of errors… relating to NuGet packages (???)
I was suddenly unable to build me code any longer because [reasons]. Basically, it spit out a bunch of errors saying that warnings are now treated as errors and I have like 40 or so errors now. Then I go back to my code and I fix something in what I was busy doing and voila, no more warnings being treated as errors. Great. So any typo in my code spits out a bunch of unrelated errors. SO just know what script I am working on and always go back to working on that script whenever I get errors. Got it. Never work on more than 1 script at a time… bit counterintuitive but fine.
Then I got a few hundred more and this time I didn’t know where I went wrong so I got drastic:
- Create a new project. Open it. See that it opens. Great.
- Create a new plugin. See that it opens still, yes. Great.
- Open the project that BUILDS in the IDE inside VS 2022 and build again. Nope. 253 errors.
- Go back to the IDE, it still opens. So disable Live coding (since people tend to suggest this a lot)
- Go back to VS and … nope, still 253 errors.
- Disable seeing Intellisense warnings and, nope, 253 errors from the Unreal source!!!
I read on Google earlier that VS now treats warnings as errors and some of the NuGET plugins rely on other plugins that are considered vulnerable so we get warnings/errors relating to that so the solution is to update all vulnerable packages… except in my project when I go to the Installed tab I see no packages. Under the Consolidate tab I see 6 but once they are updated they vanish also so I cannot see any packages at all… (Tried this in my original project)
So back in the new project and the 253 errors that sprang up right after I creted a new plugin and then did nothing at all with it… The errors I am getting are:
CS0234 The type or namespace name ‘DependencyInjection’ does not exist in the namespace ‘Microsoft.Extensions’ (are you missing an assembly reference?) EpicGames.Core D:\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Core\CommandHost.cs 8
CS0246 The type or namespace name ‘ILogger’ could not be found (are you missing a using directive or an assembly reference?) EpicGames.Core D:\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Core\CommandHost.cs 23
CS0246 The type or namespace name ‘EventId’ could not be found (are you missing a using directive or an assembly reference?)|EpicGames.Core|D:\Epic Games\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Core\DefaultConsoleLogger.cs 54
Looking at the using statements at the top I see that I have an error on
using Microsoft.Extensions.Logging;
My Microsoft.Extensions namespace doesn’t include Logging. Apparently UE uses the logger extensively but my namespace doesn’t include it… go figure. So do I need to install the Microsoft.Extensions.Log* NuGet packages ???
Can’t hurt so let’s try…
Could not install package ‘Microsoft.Extensions.Logging.Abstractions 8.0.1’. You are trying to install this package into a project that targets ‘native,Version=v0.0’, but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
Okay, so clearly that is not going to work. So what now? Others have had similar problems on this forum and the solution was: “ignore the errors and just build in the IDE”. That is not an option for me because in my main project I can no longer OPEN the IDE as it says “Build the project in VS manually” and VS tells me “There are 120 errors” all of which I am told here “Ahhhh, just ignore all of them and go back to the IDE”
The IDE can’t open, VS is no help at all and “just ignore it” is not an option… so what should I do?
Anyone have any insights for me? Thanks in advance