Unable to access 'Build Action' property for .cs files

孤街浪徒 提交于 2021-01-27 12:11:58

问题


enter image description herei got a problem with my site with my app_code files and a lot of question ive read people say you need to change the proprties of the .cs files to Build Action.

by right clicking the .cs files and press proprties.

but... when i right clicking the files i cant see any option called proprties so i press F4 and it open a proprties window and i just click on the .cs file and still cant see any option i can change somthing to Build Action.

any idea why i cant see this options?

EDIT: my problem is that when i get in the file proprties i have only 2 options... thay are called: 1.Full Name 2.Full Path

EDIT2: here what i see in visual studio 2010 when i try access the protrtie menu/window http://img338.imageshack.us/img338/2359/blac.png


回答1:


As Microsoft points out in the article "Web Application Projects versus Web Site Projects":

Web application projects use Visual Studio project files (.csproj or .vbproj) to keep track of information about the project. Among other tasks, this makes it possible to specify which files are included in or excluded from the project, and therefore which files are compiled during a build.


An answer to a similiar question at CodeProject's forums reveals a hint. Abstract:

[...] Looks like you are working on a web application that is actually a Website as per Visual Studio. You would need to create a new Web Application and probably copy over the source files there. [...]

http://www.codeproject.com/Questions/173637/Setting-Build-Action-for-Files-in-App_Data




回答2:


Have you tried this: enter image description here




回答3:


You say you haven't got the option being suggested by other posters.

If this is the case, than it is quite possible that your Visual Studio settings are corrupt; this can give rise to all sorts of odd behaviour.

I would suggest you reset your settings, but please be aware you will lose any custom IDE settings that you've previously applied.

Try this:

  1. In Visual Studio, go to Tools->Import and Export Settings
  2. Choose "Reset All Settings" and click Next
  3. Choose to save your current settings if you wish, or select "no" and then click next.
  4. Choose the collection of settings( he IDE preset) you want, probably "Visual C# Development Settings"

Visual Studio will now revert all settings. Hopefully this will make the Build Action reappear.

[EDIT] It might be worth trying safe mode too.

To do this, start up a "Visual Studio Command Prompt" from your start menu/programs list in Windows, and start Visual Studio with

devenv.exe /SafeMode

Does this make the options appear?




回答4:


You can copy the file from Windows Explorer and paste it in the Solution Explorer. It will replace (or do nothing but incorporating it in the proj file) the file and recognize it as C#.




回答5:


Normally you should see a Property named "Build Action" in the first line of the Property Window. This property should be set to "Compile".




回答6:


Please select file and right click on it so that you will get following screen

enter image description here

Than click on the Properties you will get following screen

enter image description here

You can find build option in as a first option.



来源:https://stackoverflow.com/questions/9500186/unable-to-access-build-action-property-for-cs-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!