GithubHelp home page GithubHelp logo

Comments (2)

markjprice avatar markjprice commented on May 2, 2024

I have not experienced VS2022 setting a file build action to None by default.

I found this StackOverflow item by Googling but it is old and I never like messing around with the registry. https://stackoverflow.com/questions/747844/default-build-action-for-a-filetype

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:

  <ItemGroup>
    <Compile Remove="SecurityHeadersMiddleware.cs" />
  </ItemGroup>

  <ItemGroup>
    <None Include="SecurityHeadersMiddleware.cs" />
  </ItemGroup>

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.

from cs11dotnet7.

BobMolloy avatar BobMolloy commented on May 2, 2024

OK, we might as well write this one off. I'll try to keep an eye on the properties when I add a new file to a project.

from cs11dotnet7.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.