locked
HOWTO Get VS2013/Update-2 to NOT look in sub folders when compiling MVC apps. RRS feed

  • Question

  • User-2022643801 posted

    Please help. I had originally started a thread here:  http://social.msdn.microsoft.com/Forums/en-US/6cc7147c-c00a-4f74-9482-ffb1c82e93c5/howto-get-vs2013update2-to-not-look-in-sub-folders-when-compiling-mvc-apps?forum=vssetup

    The support folks said this would be best answered here, for which I moved in the original post and some follow up posts.

    I have a MVC app, that before VS2013/Update-2 would NOT look into sub folders when building. But since Update 2, it now looks into sub folders when building, and if it finds files like "web.config" in a backup folder, that was not attached to the project/solution, it throws an error like this:

    1>C:\Devel\MyMvcApp\backup-folder-not-attached-to-the-project\web.config(9): error ASPCONFIG: Section or group name 'entityFramework' is already defined. Updates to this may only occur at the configuration level where it is defined.

    I am running VS2013/Update-2 in safe mode.

    ======================

    I have more news regarding this issue.

    Also since Update 2, the VS2013 compiler is looking for CSHTML files in folder NOT-ATTACHED to the project, where before Update 2, it did not. In this case, it seems to be because the sub-folder have "View" in it like this:

    1>c:\Devel\MyMvcApp\backup-folder-not-attached-to-the-project\Views\Home\MyView.cshtml(124): error CS1729: 'MyNamespace.MyClass' does not contain a constructor that takes 5 arguments

    I have other folders with CSHTML files like that one above, where the Update 2 is not seeing them. The only difference is that one above is under "backup-folder-not-attached-to-the-project\Views" and the others are not.

    =============================

    I have more information. I tried renaming my backup\view to be backup\views/bak and VS2013\Update-2 still found it, as if it were attached to the project, and tried to compile it. This implies, it is still seeing the other CSHTML files I have in backup-sub folder, but just isn't getting any errors.

    This is nutty. I need to have a backup of my app under the same project folder so we can manage our deployments. Why is VS2013/Update-2 seeing them? How can I make this stop?

    Friday, March 28, 2014 9:17 AM

Answers

  • User-2022643801 posted

    Sorry to get back late to this. I ultimately had to move all CSHTML files not related to my project, out of their sub-root folders, to a completely different root. I was able to reproduce this on another machine, that went to Update 2, with a before-Update-2 to after-Update-2 perspective. The Update-2 has BUGS is my only conclusion. At least for the short term, moving everything to a seperate root-base solves this problem

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, April 2, 2014 9:46 AM

All replies

  • User-1454326058 posted

    Hi,

    According to your description, I would like to know how you update the VS2013 to VS2013 update 2.

    Do you download it from here: http://www.microsoft.com/en-us/download/details.aspx?id=42023

    If so, which files that you download and installed?               

    Could you reproduce that scene with the new project?

    Thanks

    Best Regards

    Sunday, March 30, 2014 11:39 PM
  • User-2022643801 posted

    I downloaded the CTP file version from http://www.microsoft.com/en-us/download/details.aspx?id=42023

    And I am able to reproduce the errors with a new project. Simply go new MVC project. Build. I chose to NOT create a new subfolder, if that has any significance.

    Build your project, no errors.

    Then using file explorer, create a new subfolder, under you solution's main, and put a cshtml file into it, with a syntax error. Do not do anything more to that file. Just then build your project again, and it will see the CSHTML file and throw an error.

    Monday, March 31, 2014 9:49 AM
  • User-1454326058 posted

    Hi,

    After I install the CTP (VS2013.2.CTP.exe), I tried create a new MVC project, then open the project in file explorer and create a subfolder, then add a cshtml file with a syntax error to it. Build the project, it still works fine.

    Since you could reproduce the errors with the new project, please share the project to me.

    # Share files and folders and change permissions

    http://windows.microsoft.com/en-us/onedrive/share-file-folder

    Thanks

    Best Regards

    Wednesday, April 2, 2014 2:17 AM
  • User-2022643801 posted

    Sorry to get back late to this. I ultimately had to move all CSHTML files not related to my project, out of their sub-root folders, to a completely different root. I was able to reproduce this on another machine, that went to Update 2, with a before-Update-2 to after-Update-2 perspective. The Update-2 has BUGS is my only conclusion. At least for the short term, moving everything to a seperate root-base solves this problem

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, April 2, 2014 9:46 AM