开发者

Visual Studio Basics: Compiling specific files and finding references

开发者 https://www.devze.com 2022-12-12 02:29 出处:网络
I\'m just getting started with Visual Studio (2010 Beta) and have some basic questions that I\'m sure have easy answers:

I'm just getting started with Visual Studio (2010 Beta) and have some basic questions that I'm sure have easy answers:

  1. When looking at sample code I often have a hard time finding the right things to add references to. For instance, a sample program opens System.ServiceModel.Web but I can't find the required reference. Web doesn't exist in System.ServiceModel reference. More generally, there doesn't seem to be a one-to-one match between namespaces that I see in code and the references to dlls I need add. The add references dialog has no search functionality so I find myself scrolling around trying to find the right dll. Is the a better way? Specifically, where's System.ServiceModel.Web?

  2. Since I'm experimenting a lot, I often have many files that have all sorts of compile errors floating around. When a try to build my project things explode with errors I'm not interested in. Is there any way to build开发者_JAVA百科 just one file in a project? Even errors in F# script files give me compile errors when I compile a project, even though they are just experimental notes.

  3. Is there a way to "Debug" and run just one project in a solution, not the entire solution? When I click debug, all these random projects start that I'm not interested in at the moment.


1) Use the object browser functionality - View->Other Windows->Object Browser - you can do a search here and then by clicking on the top-level item in the tree there is a pane that shows the path to the DLL.

This shows that on my machine ServiceModel.Web is in C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.ServiceModel.Web.dll

2) You can exclude files from being built by changing the Build Action property for them to "None"

3) Similarly you can "Unload" projects from a solution (and then reload them later) by right clicking on them and selecting unload

0

精彩评论

暂无评论...
验证码 换一张
取 消