Changing the name of the DevelopmentWebsite

Sep 11, 2007 at 9:54 PM
I am new to the WCSF and the CWAB, and I have created a WCSF project. I want to be able to change the name of the website that was initially created, and subsequently the folder in which it is stored, from DevelopmentWebsite to MyWebsite. Is this possible, and if so, how is it done?

Thanks in advance,
Sep 11, 2007 at 10:34 PM
Edited Sep 11, 2007 at 10:37 PM
Hi Mark,
You should be able to just rename the folder without any issues. (the Website in VS corresponds to the folder name) Use explorer and rename, then in VS file->open website browse to the renamed folder. Guidance should still run fine. I am doing this now and it works... cant remember if I had any initial problems, so Im going with I didnt :)

(You may want to create a test project and give it a try)

Jarod Ferguson
Sep 12, 2007 at 2:58 PM
Hi Jarod,

I tried renaming the folder in Explorer, and when I tried to load the original solution, it gave an error:

One or more projects in the solution could not be loaded for the following reason(s):
The project or web has been moved, renamed, or is not on your computer.
These projects will be labeled as unavailable in Solution Explorer. Expand the project node to show the reason the project could not be loaded.

In the solution explorer, it says (unavailable) beside the old website name, and below it says "The project or web cannot be found"

This was to be expected. So, I right click on Websites, and click Add... Existing WebSite and point it to the renamed folder.

When I try to debug (f5), it comes up with another error:

A project with an Output Type of Class Library cannot be started directly.

In order to debug this project, add an executable project to this solution which references the library project. Set the executable project as the startup project.
So then I right click on the renamed website, and click on "set as startup project" and try to debug again (f5).

The first time I try this, it gives an error (int the browser) about not being able to locate the Shell module. Being stubborn, I try a second time and get the error (in the browser):

Object reference not set to an instance of an object.

Stack Trace:

NullReferenceException: Object reference not set to an instance of an object. Microsoft.Practices.CompositeWeb.WebClientApplication.InnerPreRequestHandlerExecute(IHttpContext context) +100 Microsoft.Practices.CompositeWeb.WebClientApplication.Application_PreRequestHandlerExecute(Object sender, EventArgs e) +99 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

Same thing happens when I right click on the Default.aspx file in the site and click on "View in Browser"

Any Ideas?

Thanks for your time.
Sep 12, 2007 at 9:36 PM
Hi Mark,
No worries. Your website has lost the references to your modules and the WCSF .dlls. This can be expected because of the rename. You will need to re-add them. Right click the website, go to property pages. You should see a reference tab.
Add references to your module projects. When you build, it should bring over the WCSF dlls as dependencies of your module


If it doesnt, you may have to add them manually. When you first added your solution you probably pointed guidance automation to a library folder where you installed WCSF. Browse to this location and add references the above mentioned dlls. (any of them which you dont see in the site bin)


Once this is done give guidance a try by adding a test view with presenter. Should work.

On a side note. just to clarify, It is ok to develop the site as 'DevelopmentWebsite', and the use the publish functions (right click website and choose publish web site) to get your release to the 'MyWebSite' which you desire. Develop under 'DevelopmentWebsite', Production gets published to 'MyWebSite' - this is good practice

Jarod Ferguson