Adding References to ASP.NET projects in Whidbey

I was playing around with the May CTP release of ASP.NET Whidbey, and tried to add a reference to a library project from the same solution. The add reference button did nothing. At first I thought it was “just a bug”, but then I started thinking - there is no project file, so where is it going to keep the reference?


I ended up creating a bin folder in the root application directory and copying the assembly in there. The references tab now showed the assembly I copied in (as shown above), but recompiling the library assemby meant I had to manually copy the library assemby into the web app’s bin directory. By setting the build location of the library assembly to my web application’s bin directory I was able to recompile without having to do any manual copying.



 I’m not sure if this is the “reccomended” way, but it worked for me. Let me know if anybody out there does know the “reccomended” way. Another way around this problem that I didn’t explore might be adding the reference to the library project via the assemblies element in the web.config. I really like the “project-less web project“ idea, and assume all this will be fixed to work more intuitively in the beta and final releases.

Comments

Johnny Dev
I was able to get the "Add Reference" button to actually work on 1 of 5 machines that I tried, all running Windows XP Pro. The rest dont do anything when the button is clicked. I think this is definitely a bug but dont understand why it works on one of our machines.

If you find out why, email me at "johnny_dev" at "hotmail.com".

P.S - Your solution is a cool temporary fix. Unless you have multiple projects that need the refereced project in the same solution which is our case.
22/06/2004 3:47:00 PM
Einar Ingebrigtsen
The project reference is actually supposed to end up in the solution file.

I created a Web Custom Control that I used in the WebSite by just dragging it in, and it then created the following in the solution file :

Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "C:\WebSites\Cielo", "C:\WebSites\Cielo", "{926BE2B3-6241-4BC5-AFC8-815A593DA6CC}"
ProjectSection(WebsiteProperties) = preProject
Frontpage = false
ProjectReferences = {9F8B2381-FEDB-435F-A8B0-09ABED33ADF0}|Notus.Web.Controls.dll;
VWDPort = 24851
EndProjectSection
ProjectSection(ProjectDependencies) = postProject
{9F8B2381-FEDB-435F-A8B0-09ABED33ADF0} = {9F8B2381-FEDB-435F-A8B0-09ABED33ADF0}
EndProjectSection
EndProject


As you can see there is a project reference. This one will copy the needed binaries to the BIN directory.

Hope this was helpful.

Cheers,
Einar
28/06/2004 4:31:00 PM