Reputation: 5436
I have a locally ran ASP.NET application and a BAT script which creates a deliverable folder with .cs, .js, .css and other files. Contents are copied to development or testing environments.
There is a requirement that .cs files should have build action "Compile" on development server and "Content" on test server.
In development environment .cs files should have build action "Compile". In my Visual Studio project all .cs files have build action "compile" by default. I assume they retain this information when copied to development environment.
In test environment .cs files "should" have build action "Content". I have another BAT script which changes build action for .cs files in .proj files. Then I rebuild the project and verify that all .cs files have build action specified as "Content". Then I copy .cs files to test environment.
Is there a way I could verify that .cs files on test environment actually have build action "content"? Or is this information about build type kept somewhere else, and that is why .cs files on test environment behave as if they still have build action "compile"?
I think that in my scenario build action changes are not reflected on test server and I want to know why.
Could someone shed some light on this?
Upvotes: 0
Views: 1400
Reputation: 1387
Answering the question you put in the header:
Build action defines what is done with a file during a build. Compile is a default for .cs files which is natural because typically you want to create a machine (or msil in case of .net) code from them. From compiled cs files executable code is generated. Content means these are just files which somehow belong to your solution and should or shouldn't be copied to the destination folder during the build, this is defined by "copy to output directory" setting. Nothins special other than that is done to such files.
But I don't understand why you have to put your files build action to "content" if after you anyway have to manually copy them to test. Why can't you copy them directly from a project folder.
Upvotes: 1