Replies: 1 comment
-
Currently we don't support suppressing the load error notifications (we have an issue for it here - #7472) However - it should be possible to get the project to load successfully and allow your CI to change the TFM. You could set a default TFM that we will use to load your project, and conditionally override it with a different value in CI. Rough example:
When we load your project, we'll use net8.0 as the default. And in CI you should be able to override it to whatever. You can do something similar with Alternatively, if you have a solution file, I would recommend either removing it from the solution or creating a solution filter without the project. As long as the extension is configured to load the solution or solution filter, we won't load anything outside of it. |
Beta Was this translation helpful? Give feedback.
-
I recognize this is kind of niche, but wondering if anyone had a thought.
I have a small
.csproj
template that I use to test single-file scripts. It looks like this:When I use
dotnet build
I'll pass theSourceFile
andFramework
values so it gets properly populated. (This gets used in a GitHub actions matrix to test across multiple versions of .NET.)But whenever I load the project in VS Code, it complains:
Error while loading [path]: The "ResolvePackageAssets" task was not given a value for the required parameter "TargetFramework".
Very understandable!However: this error keeps popping up even if I say "Turn off Info and Warning Notifications from 'C#'" (maybe that's a VS Code bug?). I don't want to disable C# support entirely because I still want to make use of it elsewhere in the project. It's just this stray template file causing the annoyance. If I rename it to end with, say,
.csproj.template
and pass it directly todotnet build
, it seems to want a more complete file (complaining aboutCreateManifestResourceNames
missing, for example).Is there a way to just silence this warning, which is meaningless in this context, so that I don't have to see it every time I start the project? (This is a polyglot monorepo, so I'm not even using C# most of the time I work in it!)
Beta Was this translation helpful? Give feedback.
All reactions