You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The app.UseMiddleware statement throws this compiler error:
Error CS0246 The type or namespace name 'SecurityHeaders' could not be found
(are you missing a using directive or an assembly reference?) Northwind.WebApi
C:\cs11dotnet7\PracticalApps\Northwind.WebApi\Program.cs
77 Active
This is another example of adding a class file (SecurityHeadersMiddleware.cs) and finding that its build action is set to "None". I don't know if this is a VS2022 problem or something I'm doing incorrectly.
The text was updated successfully, but these errors were encountered:
It might be worth you experimenting with creating new projects and adding various file types and immediately seeing what the settings are in Properties window and comparing that to the .csproj file.
For example, adding a C# class file named SecurityHeadersMiddleware.cs to an ASP.NET Core project should default its Build Action to C# compiler and no entry for it should be made in the .csproj file. But if the Build Action for that file is changed to None then the following entries are added to the .csproj file:
I will think about how to add a section to the next edition about build actions, especially in ASP.NET Core projects, since it'd be a useful topic for all readers to be aware of.
Bullet 2:
The app.UseMiddleware statement throws this compiler error:
Error CS0246 The type or namespace name 'SecurityHeaders' could not be found
(are you missing a using directive or an assembly reference?) Northwind.WebApi
C:\cs11dotnet7\PracticalApps\Northwind.WebApi\Program.cs
77 Active
This is another example of adding a class file (SecurityHeadersMiddleware.cs) and finding that its build action is set to "None". I don't know if this is a VS2022 problem or something I'm doing incorrectly.
The text was updated successfully, but these errors were encountered: