I have a visual studio project, which includes a directory with a bunch of migration scripts in .sql. Trouble is these scripts are for a postgres database.
VS is opening those scripts, and finding hundreds of "errors" in them - which makes it very difficult to search for an actual error, if I have a build problem.
In the perfect world they'd be validated as postgres scripts - but I'd be very happy with just the ability to tell visual studio "don't go anywhere near anything ending with .sql, for validation". Is it possible to do that, in VS 2022 Professional?
I know this is old, but it was the first result for a lot of my searches. Plus I was having a lot of trouble with VS 2022, and the links the nobs commented above don't work anymore, or aren't even relevant to the question, so I figured I'd share my solution.
For me, the SQL files were being scanned as C#, probably because I lazily created the files as C# classes through the VS UI originally, and then changed their extension. I'm guessing some weird properties were set, because when I clicked the file properties I noticed they were being compiled as C#, which would explain why my intellisense was technically working for the SQL, but was still resulting in a lot of strange error messages that wouldn't be reflected with any of the typical red squiggly underlines.
After opening the properties of the problem file, simply change the build action from C# to None, and it should fix the issue if you did something similar. Hope this helps someone :)
photo of myself executing the above step
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With