Although projectless development simplifies life, the last vestiges of Visual Studio’s solution-based system
are still lurking behind the scenes.
When you create a web application, Visual Studio actually creates solution files (.sln and .suo) in a userspecific
directory like c:\Users\[UserName]\Documents\Visual Studio 2010\Projects\[WebsiteFolderName].
The solution files provide a few Visual Studio-specific features that aren’t directly related to ASP.NET, such
as debugging settings. For example, if you add a breakpoint to the code in a web page (as discussed in the
“Visual Studio Debugging” section later in this chapter), Visual Studio stores the breakpoint in the .suo file.
The next time you open the website, Visual Studio locates the matching solution files automatically.
Similarly, Visual Studio uses the solution files to keep track of the files that are currently open in the design
environment so that it can restore your view when you return to the website. This approach to solution
management is fragile—obviously, if you move the website from one location to another, you lose all this
information. However, because this information isn’t really all that important (think of it as a few projectspecific
preferences), losing it isn’t a serious problem. The overall benefits of a projectless system are
usually worth the trade-off.
If you want a more permanent solution, you can save your solution files explicitly in a location of your
choosing. To do so, simply click the top item in the Solution Explorer (which represents your solution). For
example, if you open a folder named MyWebSite, the top item is named Solution 'MyWebSite'. Then,
choose File ➤ Save [SolutionName] As. This technique is handy if you’ve created a solution that combines
multiple applications (for example, a projectless website and a class library component) and you want to
edit and debug them at the same time.
Hiç yorum yok:
Yorum Gönder