Home Dashboard Directory Help
Search

Master Page error (VS2008 design view) by M Veenman


Status: 

Closed
 as By Design Help for as By Design


0
0
Sign in
to vote
Type: Bug
ID: 373334
Opened: 10/6/2008 3:38:29 AM
Access Restriction: Public
1
Workaround(s)
view
0
User(s) can reproduce this bug

Description

After upgrading from VS2005 to VS2008 I run into a problem viewing my pages in design mode. The error message displayed in the designer is:

Master Page error
The Master Page file 'http://localhost/MainProject/Page.Master' cannot be loaded.
Correct the problem in Code view.

This problem occurs for projects that are nested. For example:

The application consists out of two projects, one MainProject and one SubProject, and the bin folder from the MainProject is used for both assemblies.
The MainProject works fine and the use of the Master Page file located in the root (as described in the error above) works fine.
For the SubProject (located: http://localhost/MainProject/SubProject) the designer gives the error message like above.

I created this Main/Sub setup to see if the error could be reproduced and to make sure it wasn't generated during project conversion from VS2005 to VS2008. Unfortunately the error persists.

Some other things where tried to see if the error coud be resolved/worked around. I tried including the MainProject's assembly in the SubProject's references, I tried to change the Master Page location to 'C:\inetpub\wwwroot\MainProject\Page.Master', I tried to recreate the SubProject's pages by using the 'Web Content Form' template from the 'Add New Item' templates by first creating a dummy Master Page in the SubProject and changing that after.

Unfortunately, none of these attempts gave me a working solution.

Building both projects and opening them in the browser displays the projects just fine. The problem lies in the VS2008 designer view.

Details
Sign in to post a comment.
Posted by Microsoft on 5/7/2009 at 12:20 PM
This is by design. To fix the attached project, right click on Webapplication1, select properties and on the web tab, enabled the Override application root URL checkbox and set the path to http://localhost/WebApplication4. Then, in the page directive of WebApplication1\ContentPage.aspx, change MasterPageFile=”..\RootProject.Master.Master” to MasterPageFile=”~/RootProject.Master.Master”. After doing these steps, I was able to get design view of the content page to load the master page.
Posted by M Veenman on 10/16/2008 at 2:15 AM
As nothing seems to be happening we have invested more time on this issue again.

The problem can be resolved by adding the MainProject to the SubProject Solution as well. When the original solution file for the SubProject is openend it will produce the error as described here. When the project file for the MainProject is added to the solution file for the SubProject the problem seems to disappear.

Still the error seems strange and has something to do with the IDE, but at least this can give our developer a fairly descent workaround to the problem.

Of course all sub solutions will have to be extended with the main project file.

Please respond with a progress update on the issue so far.
Posted by M Veenman on 10/14/2008 at 12:13 AM
Could anyone give a status update on this issue. Our company is waiting for the move from VS2005 to VS2008 due this issue.
Posted by M Veenman on 10/7/2008 at 2:07 AM
Additional info:

When trying to switch to Design View for a SubProject on can create a new Master Page file for that project and in Source View change the Master Page to use f.ex. '~/SubProject/Temp.Master'.

This makes it possible to switch the IDE to Desgin View. Of course it's a rather time consuming work around and will result in forgetting to change the Master Page back more then once.
Posted by M Veenman on 10/6/2008 at 11:53 PM
Thanks for the fast reply.
A fresh created pair of VS2008 projects are included as zipfile. The zip contains MainProject and SubProject solutions. The SubProject nested inside the MainProject. Our development clients are setup by creating only a virtual directory in IIS for the MainProject. This setup worked just fine in VS2005. The build solution also works fine for VS2008, the only problem is during design time, which leaves us with source and code view only for the SubProject.

*posting this message here as well to be sure it gets to the right place*
Posted by M Veenman on 10/6/2008 at 11:53 PM
Thanks for the fast reply.
A fresh created pair of VS2008 projects are included as zipfile. The zip contains MainProject and SubProject solutions. The SubProject nested inside the MainProject. Our development clients are setup by creating only a virtual directory in IIS for the MainProject. This setup worked just fine in VS2005. The build solution also works fine for VS2008, the only problem is during design time, which leaves us with source and code view only for the SubProject.
Posted by Microsoft on 10/6/2008 at 8:32 PM
Thanks for reporting the issue.
In order to fix the issue, we must first reproduce the issue in our labs.

It may help if you provide us with a zipped project, which can give us more details about the problem.

It would be greatly appreciated if you could provide us with that information as quickly as possible.

Thanks again for your efforts and we look forward to hearing from you.
Visual Studio Product Team
Sign in to post a workaround.
Posted by M Veenman on 10/16/2008 at 2:17 AM
As described in the comments:

Adding the main project file to the solutions for the sub projects will resolve the load problems.