Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / September 2003

Tip: Looking for answers? Try searching our database.

.csproj files

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bob - 10 Sep 2003 21:57 GMT
I have a solution with two C# projects in it. One is a
class assembly and the other is a ASP.Net Web project.
We've noticed that if I double click the class
assembly .csproj file in Windows explorer, it brings up
the whole solution with both projects in it. If I double
click the ASP.NET .csproj file under inetpub, it brings
up ONLY the project itself, no solution.
I checked both .csproj files and see no reference to the
solution file.

The structure is
c:\..\Visual Studio Projects\H1Rep
c:\..\Visual Studio Projects\H1Rep\.sln
c:\..\Visual Studio Projects\H1Rep\.suo
c:\..\Visual Studio Projects\H1Rep\ClassAssembly
c:\..\Visual Studio Projects\H1Rep\ClassAssembly\.csproj

c:\inetpub\wwwroot\H1Rep\Rep\.csproj

In VSS the structure is:

$Reporting\H1Rep
$Reporting\H1Rep\.sln
$Reporting\H1Rep\.suo
$Reporting\H1Rep\ClassAssembly
$Reporting\H1Rep\ClassAssembly\.csproj

Is the IDE doing a search, or somehow know the solution
file for the assembly project? Is VSS involved somehow?
This is not a big deal, just wondering what is going on.

Thanks
Dan Moseley[MSFT] - 27 Sep 2003 04:04 GMT
I believe the way it works is approximately this:

(1) you choose a project file somewhere, of whatever type
(2) VS has to put it in a solution. You can't work with a project outside of a solution.
(3) First it looks for a solution with the same base name as the project in the same folder.
(4) Then it tries the folder above.
(5) If that doesn't find one, it looks for a solution in the same folder that contains the project you chose, with any name.
(6) It probably tries the folder above again.
(7) If it finds such a solution, it opens it, and this opens your project too. If all this fails to find such a solution, it creates an unsaved one with
the same base name  and puts your project in it.

I haven't verified this is exactly right, but you get the idea.

In your case, the first project file is presumably in the folder below the solution, so VS finds it. However the web project is not in the same
folder or the folder below the solution, so VS doesn't find it.

This heuristic doesn't work so well for web projects, since typically they are located in a vroot somewhere else rather than under the
solution file. In fact, there is an annoying buglet in VS 2002 and VS 2003 related to this. If you do Open Project from Web, and navigate to
your web project, then pick a solution instead of a web project, it gives an error about it being in a bad format, rather than actually opening
the solution. This is lame; it's because it opens web projects in a different way to regular projects. It's a shame we didn't fix this in VS 2003. I
think the easiest way to work around all this is to keep the solution with your non-web project and always open that solution (or the non-web
project, which will open the solution).

The next version of VS should fix this.

Dan [ms]

--
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| >Content-Class: urn:content-classes:message
| >From: "Bob" <bnienosphamus@mindspring.com>
[quoted text clipped - 48 lines]
| >
| >Thanks

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.