locked
ASP.NET Web Forms Application: The master page file cannot be loaded in design view after changing the web project output path in VS 2013 RRS feed

  • Question

  • Hello,

    After migrating our web application from VS 2010 to VS 2013 we encountered an error when opening asp.net web form page with master page in design view. In design view following error message is displayed: "The master page '~/TestMaster.master' cannot be loaded.". The application root contains TestMaster.master file. 

    We have discovered that the error is related to the changed Output path for the web application (Project properties -> Build -> Output path). It looks like the application's root is determined by the relative location of the OutputPath instead of relative location of the web.config. 

    Similar error occur when running "View in browser" action. Invalid url is send to the browser. 

    Sample - Output path for WebProject is set to MyBinFolder

    HomeFolder

       MyBinFolder

       WebProjectFolder

           web.config

           Default.aspx

           TestMaster.master

    View in browser action generates following url: http://localhost:12345/WebProjectFolder/Default.aspx. In VS 2010 following url was generated: http://localhost:12345:Default.aspx

    Is there any workarround for a proper url creation in VS 2013 after changing the Output path.


    Thursday, January 30, 2014 11:56 AM

All replies

  • Hi BojanB1,

    I suggest you try the ASP.NET forums instead because this forum is about the VS architecture tools for visualizing and modeling your code. I'll move this to the Visual Studio General forum though.

    Thanks!


    Esther Fan | Visual Studio | If a post answers your question, please mark it as the answer. Thanks!


    Friday, January 31, 2014 8:15 PM
  • Hi Ester,

    Thank you for your reply. I will follow your suggestion and try ASP.NET forums insted.

    Sunday, February 2, 2014 4:16 PM
  • I have followed your suggestion and tried at asp.net forms. They provided an old link from year 2007 which describes troubles with configuration changes. For a better support, the suggested to contact Visual Studio forms. ASP.NET form response can be found here http://forums.asp.net/p/1965154/5618514.aspx?ASP+NET+Web+Forms+Application+The+master+page+file+cannot+be+loaded+in+design+view+after+changing+the+web+project+output+path+in+VS+2013

    PS: In our project we don't have any configuration changes, we simply change the outpath for the project. The reason is common output folder for multiple projects.

    • Edited by BojanB1 Thursday, February 6, 2014 6:27 AM
    Thursday, February 6, 2014 6:25 AM
  • Hi BojanB1,

    We have discovered that the error is related to the changed Output path for the web application (Project properties -> Build -> Output path).

    As you said that you change the output path, could you change it to the previous same output settings? And then Clean and Rebuild your app. It seems it couldn’t find the files after you change the output path.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, February 7, 2014 5:36 AM
  • I followed your suggestion and changed the OutputPath to the original value. Project Clean and Rebuild didn't help, but after restarting the Visual Studio, everything worked as expected.

    Unfortunatelly i require different output path because it should points to the common library folder. The same common library folder is used by different solutions.

    Friday, February 7, 2014 6:15 AM
  • Hi BojanB1,

    As far as I know, the default output path for web app is the bin folder, I’m not very sure that how you change the output path, maybe you could check whether it has the account limitation for this new path.

    1. Since you update the old VS2010 app to VS2013, could you change the output path under the VS2010 project, check it again. Note: please take a backup before you change the output path.
    2. Could you just change the bin output path to “bin\myfolder or others” in your project properties? I test a simple web app in my side, it works well.
    3. Maybe you could delete the bin folder in your project path, and then clean and rebuild your app again.
    4. You’d better discuss this issue with your team members, for example, whether you reference any assemblies which were in the bin folder, but you didn’t copy it after you change the output path. You could compare the new output path with the previous VS2010 project, maybe you could find the different dll files in your two project output path.

    Not the real web expert, but if possible, you’d better check the web.config file like the following thread:

    http://stackoverflow.com/questions/18359145/changing-output-directory-for-asp-net-project-in-visual-studio

    http://forums.asp.net/t/1303052.aspx

    Hope it could help.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, February 7, 2014 7:39 AM
  • When I tried to reproduce your proposed scenario in VS 2010, I discovered that I missed some important factor. OutputPath in our web project is set to "..\MyBinFolder". But in post-build event we use Junction.exe to create folder shortcut to the "..\MyBinFolder" folder. This is out post-build event:

    SET ROOT_DIR=$(SolutionDir)..\..\..\..
    SET JUNCTION=%ROOT_DIR%\80Tool\junction.exe
    SET BIN_DIR=$(ProjectDir)..\MyBinFolder\

    if not exist   $(ProjectDir)bin\nul %JUNCTION% $(ProjectDir)bin %BIN_DIR%

    So this is our folder structure:

    HomeFolder

       MyBinFolder

       WebProjectFolder

           Bin (shortcut folder created by junction.exe)

           web.config

           Default.aspx

           TestMaster.master

    Described scenario with moved bin folder in a web project and using junction tool to create folder shortcut work in VS 2010, but no longer in VS 2013.

    I also checked your suggestions. I run VS as administrator and withUAC disabled. I can confirm that i do not have any security problems accessing the folder. I also check that all required assemblies are copied to the moved bin folder.

    I apology for my incomplete description of the problem.


    • Edited by BojanB1 Friday, February 7, 2014 9:04 AM
    Friday, February 7, 2014 9:01 AM
  • Hi BojanB1,

    Thanks for your response.

    Described scenario with moved bin folder in a web project and using junction tool to create folder shortcut work in VS 2010, but no longer in VS 2013.

    Maybe the real issue is the compatibility between the junction tool and VS2013.

    To get the issue confirmed and diagnose by product team, would you please create connect report for it? You will get email notification for update.http://connect.microsoft.com/VisualStudio/feedback/CreateFeedback.aspx, if you submit it, you could share me the link here, so we could know the latest information about this issue from product team expert. Thanks for your understanding.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, February 10, 2014 2:31 AM