VS 2008 keeps removing and re-adding ASPXCodeBehind












69















I've got a VS 2008 C# Web project and whenever I make some changes to the files in it (not even to the project file itself) VS will remove some lines like this from the csproj file:



<SubType>ASPXCodeBehind</SubType>


So something like this:



<Compile Include="Default.aspx.cs">
<DependentUpon>Default.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>


will become



<Compile Include="Default.aspx.cs">
<DependentUpon>Default.aspx</DependentUpon>
</Compile>


BUT the next time I work on this project it will add those lines back! It keeps going back and forth like this, resulting in a lot of meaningless "changes" in our source control system. This never used to happen with VS 2005 and it doesn't seem to be happening for other developers who work on the same project file, only for me.



Does anyone know why this is happening and how I can stop it from doing this?










share|improve this question




















  • 1





    how strange, this has just happened to me for the first time. I checked in my solution last night and this morning my .csproj file has changed. having had a little dig around on Google it seems that this has affected a handful of people for years! but no reason or resolution so far as I can see..

    – Alex
    Jun 17 '09 at 5:57






  • 1





    I have the same problem except the the subtype element does not added again. Only happens to me as well and not to any of the other developers on the team. I have a discussion about it here, hopefully I will get some answers.

    – user152123
    Sep 14 '09 at 15:22






  • 1





    Happening to me as well. Totally obnoxious. Two people on the team have VS that do this while the others don't. Seems like something in a hotfix is doing this. No help out there for this that I can find.

    – jcollum
    Sep 17 '10 at 16:43






  • 4





    this is currently happening to me, but me I have Visual studio 2010

    – Guillaume V
    Feb 24 '12 at 20:09






  • 1





    @PitzZh's answer is probably going to be deleted. Reproducing here: "Please vote for this bug in Microsoft Bug Report System for VS2017. https://developercommunity.visualstudio.com/content/problem/389773/vs-2017-keeps-removing-and-re-adding-aspxcodebehin.html".

    – jww
    Nov 29 '18 at 11:53


















69















I've got a VS 2008 C# Web project and whenever I make some changes to the files in it (not even to the project file itself) VS will remove some lines like this from the csproj file:



<SubType>ASPXCodeBehind</SubType>


So something like this:



<Compile Include="Default.aspx.cs">
<DependentUpon>Default.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>


will become



<Compile Include="Default.aspx.cs">
<DependentUpon>Default.aspx</DependentUpon>
</Compile>


BUT the next time I work on this project it will add those lines back! It keeps going back and forth like this, resulting in a lot of meaningless "changes" in our source control system. This never used to happen with VS 2005 and it doesn't seem to be happening for other developers who work on the same project file, only for me.



Does anyone know why this is happening and how I can stop it from doing this?










share|improve this question




















  • 1





    how strange, this has just happened to me for the first time. I checked in my solution last night and this morning my .csproj file has changed. having had a little dig around on Google it seems that this has affected a handful of people for years! but no reason or resolution so far as I can see..

    – Alex
    Jun 17 '09 at 5:57






  • 1





    I have the same problem except the the subtype element does not added again. Only happens to me as well and not to any of the other developers on the team. I have a discussion about it here, hopefully I will get some answers.

    – user152123
    Sep 14 '09 at 15:22






  • 1





    Happening to me as well. Totally obnoxious. Two people on the team have VS that do this while the others don't. Seems like something in a hotfix is doing this. No help out there for this that I can find.

    – jcollum
    Sep 17 '10 at 16:43






  • 4





    this is currently happening to me, but me I have Visual studio 2010

    – Guillaume V
    Feb 24 '12 at 20:09






  • 1





    @PitzZh's answer is probably going to be deleted. Reproducing here: "Please vote for this bug in Microsoft Bug Report System for VS2017. https://developercommunity.visualstudio.com/content/problem/389773/vs-2017-keeps-removing-and-re-adding-aspxcodebehin.html".

    – jww
    Nov 29 '18 at 11:53
















69












69








69


10






I've got a VS 2008 C# Web project and whenever I make some changes to the files in it (not even to the project file itself) VS will remove some lines like this from the csproj file:



<SubType>ASPXCodeBehind</SubType>


So something like this:



<Compile Include="Default.aspx.cs">
<DependentUpon>Default.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>


will become



<Compile Include="Default.aspx.cs">
<DependentUpon>Default.aspx</DependentUpon>
</Compile>


BUT the next time I work on this project it will add those lines back! It keeps going back and forth like this, resulting in a lot of meaningless "changes" in our source control system. This never used to happen with VS 2005 and it doesn't seem to be happening for other developers who work on the same project file, only for me.



Does anyone know why this is happening and how I can stop it from doing this?










share|improve this question
















I've got a VS 2008 C# Web project and whenever I make some changes to the files in it (not even to the project file itself) VS will remove some lines like this from the csproj file:



<SubType>ASPXCodeBehind</SubType>


So something like this:



<Compile Include="Default.aspx.cs">
<DependentUpon>Default.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>


will become



<Compile Include="Default.aspx.cs">
<DependentUpon>Default.aspx</DependentUpon>
</Compile>


BUT the next time I work on this project it will add those lines back! It keeps going back and forth like this, resulting in a lot of meaningless "changes" in our source control system. This never used to happen with VS 2005 and it doesn't seem to be happening for other developers who work on the same project file, only for me.



Does anyone know why this is happening and how I can stop it from doing this?







asp.net visual-studio visual-studio-2010 visual-studio-2008 visual-studio-2015






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 30 '15 at 16:11









Kevin Evans

2,91233460




2,91233460










asked Nov 5 '08 at 0:58









EMPEMP

29.1k43141208




29.1k43141208








  • 1





    how strange, this has just happened to me for the first time. I checked in my solution last night and this morning my .csproj file has changed. having had a little dig around on Google it seems that this has affected a handful of people for years! but no reason or resolution so far as I can see..

    – Alex
    Jun 17 '09 at 5:57






  • 1





    I have the same problem except the the subtype element does not added again. Only happens to me as well and not to any of the other developers on the team. I have a discussion about it here, hopefully I will get some answers.

    – user152123
    Sep 14 '09 at 15:22






  • 1





    Happening to me as well. Totally obnoxious. Two people on the team have VS that do this while the others don't. Seems like something in a hotfix is doing this. No help out there for this that I can find.

    – jcollum
    Sep 17 '10 at 16:43






  • 4





    this is currently happening to me, but me I have Visual studio 2010

    – Guillaume V
    Feb 24 '12 at 20:09






  • 1





    @PitzZh's answer is probably going to be deleted. Reproducing here: "Please vote for this bug in Microsoft Bug Report System for VS2017. https://developercommunity.visualstudio.com/content/problem/389773/vs-2017-keeps-removing-and-re-adding-aspxcodebehin.html".

    – jww
    Nov 29 '18 at 11:53
















  • 1





    how strange, this has just happened to me for the first time. I checked in my solution last night and this morning my .csproj file has changed. having had a little dig around on Google it seems that this has affected a handful of people for years! but no reason or resolution so far as I can see..

    – Alex
    Jun 17 '09 at 5:57






  • 1





    I have the same problem except the the subtype element does not added again. Only happens to me as well and not to any of the other developers on the team. I have a discussion about it here, hopefully I will get some answers.

    – user152123
    Sep 14 '09 at 15:22






  • 1





    Happening to me as well. Totally obnoxious. Two people on the team have VS that do this while the others don't. Seems like something in a hotfix is doing this. No help out there for this that I can find.

    – jcollum
    Sep 17 '10 at 16:43






  • 4





    this is currently happening to me, but me I have Visual studio 2010

    – Guillaume V
    Feb 24 '12 at 20:09






  • 1





    @PitzZh's answer is probably going to be deleted. Reproducing here: "Please vote for this bug in Microsoft Bug Report System for VS2017. https://developercommunity.visualstudio.com/content/problem/389773/vs-2017-keeps-removing-and-re-adding-aspxcodebehin.html".

    – jww
    Nov 29 '18 at 11:53










1




1





how strange, this has just happened to me for the first time. I checked in my solution last night and this morning my .csproj file has changed. having had a little dig around on Google it seems that this has affected a handful of people for years! but no reason or resolution so far as I can see..

– Alex
Jun 17 '09 at 5:57





how strange, this has just happened to me for the first time. I checked in my solution last night and this morning my .csproj file has changed. having had a little dig around on Google it seems that this has affected a handful of people for years! but no reason or resolution so far as I can see..

– Alex
Jun 17 '09 at 5:57




1




1





I have the same problem except the the subtype element does not added again. Only happens to me as well and not to any of the other developers on the team. I have a discussion about it here, hopefully I will get some answers.

– user152123
Sep 14 '09 at 15:22





I have the same problem except the the subtype element does not added again. Only happens to me as well and not to any of the other developers on the team. I have a discussion about it here, hopefully I will get some answers.

– user152123
Sep 14 '09 at 15:22




1




1





Happening to me as well. Totally obnoxious. Two people on the team have VS that do this while the others don't. Seems like something in a hotfix is doing this. No help out there for this that I can find.

– jcollum
Sep 17 '10 at 16:43





Happening to me as well. Totally obnoxious. Two people on the team have VS that do this while the others don't. Seems like something in a hotfix is doing this. No help out there for this that I can find.

– jcollum
Sep 17 '10 at 16:43




4




4





this is currently happening to me, but me I have Visual studio 2010

– Guillaume V
Feb 24 '12 at 20:09





this is currently happening to me, but me I have Visual studio 2010

– Guillaume V
Feb 24 '12 at 20:09




1




1





@PitzZh's answer is probably going to be deleted. Reproducing here: "Please vote for this bug in Microsoft Bug Report System for VS2017. https://developercommunity.visualstudio.com/content/problem/389773/vs-2017-keeps-removing-and-re-adding-aspxcodebehin.html".

– jww
Nov 29 '18 at 11:53







@PitzZh's answer is probably going to be deleted. Reproducing here: "Please vote for this bug in Microsoft Bug Report System for VS2017. https://developercommunity.visualstudio.com/content/problem/389773/vs-2017-keeps-removing-and-re-adding-aspxcodebehin.html".

– jww
Nov 29 '18 at 11:53














4 Answers
4






active

oldest

votes


















10














For me, the difference depends on whether or not the web project is open in Visual Studio.



I find if I commit the project file to version control with the project open in Visual Studio the SubType elements are present. Closing the solution/project then removes the SubType elements from the project file. Now I always ensure my commits are performed with the project closed in VS to avoid unnecessary changes to the project file.






share|improve this answer
























  • I think this is the solution I needed. Thanks.

    – devlord
    Sep 6 '12 at 5:12











  • Did not work for VS 2013 for me

    – mimo
    Aug 19 '16 at 7:18



















6














Working on VS2010 and solved this issue by deleting solutionFileName.sln.DotSettings.user file and solutionFileName.suo. That helped me, give it a try.






share|improve this answer































    4














    Splitting the content of your file into multiple files - one file per class may help.



    https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=283434






    share|improve this answer





















    • 1





      Thanks, but no, that doesn't help - I only have the one class (an ASPX page codebehind class) in each affected file.

      – EMP
      Nov 7 '08 at 5:30






    • 1





      I had the same problem with VS 2015: connect.microsoft.com/VisualStudio/Feedback/Details/1650262 It happens for code-behind files with multiple classes. Reordering classes fixes the problem (main page / control class should be first in code behind file)

      – Vitaliy Shibaev
      Aug 21 '15 at 7:16





















    0














    These lines are also appearing in the project file in VS2012 when committing project changes in Tortoise SVN. This project used to be a website that I converted into a web application.



    I was able to bypass this issue using the following steps which do not require closing the project:




    1. Just prior to committing to SVN, clean the solution using "BUILD > Clean Solution".

    2. Click the "Save All" button to save the project file.

    3. Commit changes using Tortoise SVN.

    4. Continue working on project...






    share|improve this answer






















      protected by Makyen Nov 29 '18 at 11:50



      Thank you for your interest in this question.
      Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



      Would you like to answer one of these unanswered questions instead?














      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      10














      For me, the difference depends on whether or not the web project is open in Visual Studio.



      I find if I commit the project file to version control with the project open in Visual Studio the SubType elements are present. Closing the solution/project then removes the SubType elements from the project file. Now I always ensure my commits are performed with the project closed in VS to avoid unnecessary changes to the project file.






      share|improve this answer
























      • I think this is the solution I needed. Thanks.

        – devlord
        Sep 6 '12 at 5:12











      • Did not work for VS 2013 for me

        – mimo
        Aug 19 '16 at 7:18
















      10














      For me, the difference depends on whether or not the web project is open in Visual Studio.



      I find if I commit the project file to version control with the project open in Visual Studio the SubType elements are present. Closing the solution/project then removes the SubType elements from the project file. Now I always ensure my commits are performed with the project closed in VS to avoid unnecessary changes to the project file.






      share|improve this answer
























      • I think this is the solution I needed. Thanks.

        – devlord
        Sep 6 '12 at 5:12











      • Did not work for VS 2013 for me

        – mimo
        Aug 19 '16 at 7:18














      10












      10








      10







      For me, the difference depends on whether or not the web project is open in Visual Studio.



      I find if I commit the project file to version control with the project open in Visual Studio the SubType elements are present. Closing the solution/project then removes the SubType elements from the project file. Now I always ensure my commits are performed with the project closed in VS to avoid unnecessary changes to the project file.






      share|improve this answer













      For me, the difference depends on whether or not the web project is open in Visual Studio.



      I find if I commit the project file to version control with the project open in Visual Studio the SubType elements are present. Closing the solution/project then removes the SubType elements from the project file. Now I always ensure my commits are performed with the project closed in VS to avoid unnecessary changes to the project file.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Sep 21 '11 at 1:13









      TomTom

      760612




      760612













      • I think this is the solution I needed. Thanks.

        – devlord
        Sep 6 '12 at 5:12











      • Did not work for VS 2013 for me

        – mimo
        Aug 19 '16 at 7:18



















      • I think this is the solution I needed. Thanks.

        – devlord
        Sep 6 '12 at 5:12











      • Did not work for VS 2013 for me

        – mimo
        Aug 19 '16 at 7:18

















      I think this is the solution I needed. Thanks.

      – devlord
      Sep 6 '12 at 5:12





      I think this is the solution I needed. Thanks.

      – devlord
      Sep 6 '12 at 5:12













      Did not work for VS 2013 for me

      – mimo
      Aug 19 '16 at 7:18





      Did not work for VS 2013 for me

      – mimo
      Aug 19 '16 at 7:18













      6














      Working on VS2010 and solved this issue by deleting solutionFileName.sln.DotSettings.user file and solutionFileName.suo. That helped me, give it a try.






      share|improve this answer




























        6














        Working on VS2010 and solved this issue by deleting solutionFileName.sln.DotSettings.user file and solutionFileName.suo. That helped me, give it a try.






        share|improve this answer


























          6












          6








          6







          Working on VS2010 and solved this issue by deleting solutionFileName.sln.DotSettings.user file and solutionFileName.suo. That helped me, give it a try.






          share|improve this answer













          Working on VS2010 and solved this issue by deleting solutionFileName.sln.DotSettings.user file and solutionFileName.suo. That helped me, give it a try.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 10 '12 at 19:18









          Alex DenysenkoAlex Denysenko

          14414




          14414























              4














              Splitting the content of your file into multiple files - one file per class may help.



              https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=283434






              share|improve this answer





















              • 1





                Thanks, but no, that doesn't help - I only have the one class (an ASPX page codebehind class) in each affected file.

                – EMP
                Nov 7 '08 at 5:30






              • 1





                I had the same problem with VS 2015: connect.microsoft.com/VisualStudio/Feedback/Details/1650262 It happens for code-behind files with multiple classes. Reordering classes fixes the problem (main page / control class should be first in code behind file)

                – Vitaliy Shibaev
                Aug 21 '15 at 7:16


















              4














              Splitting the content of your file into multiple files - one file per class may help.



              https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=283434






              share|improve this answer





















              • 1





                Thanks, but no, that doesn't help - I only have the one class (an ASPX page codebehind class) in each affected file.

                – EMP
                Nov 7 '08 at 5:30






              • 1





                I had the same problem with VS 2015: connect.microsoft.com/VisualStudio/Feedback/Details/1650262 It happens for code-behind files with multiple classes. Reordering classes fixes the problem (main page / control class should be first in code behind file)

                – Vitaliy Shibaev
                Aug 21 '15 at 7:16
















              4












              4








              4







              Splitting the content of your file into multiple files - one file per class may help.



              https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=283434






              share|improve this answer















              Splitting the content of your file into multiple files - one file per class may help.



              https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=283434







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Sep 2 '10 at 14:57









              abatishchev

              69.2k69262393




              69.2k69262393










              answered Nov 6 '08 at 21:28









              Eren AygunesEren Aygunes

              959915




              959915








              • 1





                Thanks, but no, that doesn't help - I only have the one class (an ASPX page codebehind class) in each affected file.

                – EMP
                Nov 7 '08 at 5:30






              • 1





                I had the same problem with VS 2015: connect.microsoft.com/VisualStudio/Feedback/Details/1650262 It happens for code-behind files with multiple classes. Reordering classes fixes the problem (main page / control class should be first in code behind file)

                – Vitaliy Shibaev
                Aug 21 '15 at 7:16
















              • 1





                Thanks, but no, that doesn't help - I only have the one class (an ASPX page codebehind class) in each affected file.

                – EMP
                Nov 7 '08 at 5:30






              • 1





                I had the same problem with VS 2015: connect.microsoft.com/VisualStudio/Feedback/Details/1650262 It happens for code-behind files with multiple classes. Reordering classes fixes the problem (main page / control class should be first in code behind file)

                – Vitaliy Shibaev
                Aug 21 '15 at 7:16










              1




              1





              Thanks, but no, that doesn't help - I only have the one class (an ASPX page codebehind class) in each affected file.

              – EMP
              Nov 7 '08 at 5:30





              Thanks, but no, that doesn't help - I only have the one class (an ASPX page codebehind class) in each affected file.

              – EMP
              Nov 7 '08 at 5:30




              1




              1





              I had the same problem with VS 2015: connect.microsoft.com/VisualStudio/Feedback/Details/1650262 It happens for code-behind files with multiple classes. Reordering classes fixes the problem (main page / control class should be first in code behind file)

              – Vitaliy Shibaev
              Aug 21 '15 at 7:16







              I had the same problem with VS 2015: connect.microsoft.com/VisualStudio/Feedback/Details/1650262 It happens for code-behind files with multiple classes. Reordering classes fixes the problem (main page / control class should be first in code behind file)

              – Vitaliy Shibaev
              Aug 21 '15 at 7:16













              0














              These lines are also appearing in the project file in VS2012 when committing project changes in Tortoise SVN. This project used to be a website that I converted into a web application.



              I was able to bypass this issue using the following steps which do not require closing the project:




              1. Just prior to committing to SVN, clean the solution using "BUILD > Clean Solution".

              2. Click the "Save All" button to save the project file.

              3. Commit changes using Tortoise SVN.

              4. Continue working on project...






              share|improve this answer




























                0














                These lines are also appearing in the project file in VS2012 when committing project changes in Tortoise SVN. This project used to be a website that I converted into a web application.



                I was able to bypass this issue using the following steps which do not require closing the project:




                1. Just prior to committing to SVN, clean the solution using "BUILD > Clean Solution".

                2. Click the "Save All" button to save the project file.

                3. Commit changes using Tortoise SVN.

                4. Continue working on project...






                share|improve this answer


























                  0












                  0








                  0







                  These lines are also appearing in the project file in VS2012 when committing project changes in Tortoise SVN. This project used to be a website that I converted into a web application.



                  I was able to bypass this issue using the following steps which do not require closing the project:




                  1. Just prior to committing to SVN, clean the solution using "BUILD > Clean Solution".

                  2. Click the "Save All" button to save the project file.

                  3. Commit changes using Tortoise SVN.

                  4. Continue working on project...






                  share|improve this answer













                  These lines are also appearing in the project file in VS2012 when committing project changes in Tortoise SVN. This project used to be a website that I converted into a web application.



                  I was able to bypass this issue using the following steps which do not require closing the project:




                  1. Just prior to committing to SVN, clean the solution using "BUILD > Clean Solution".

                  2. Click the "Save All" button to save the project file.

                  3. Commit changes using Tortoise SVN.

                  4. Continue working on project...







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Dec 12 '14 at 13:33









                  laylareneelaylarenee

                  2,84472637




                  2,84472637

















                      protected by Makyen Nov 29 '18 at 11:50



                      Thank you for your interest in this question.
                      Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



                      Would you like to answer one of these unanswered questions instead?



                      Popular posts from this blog

                      404 Error Contact Form 7 ajax form submitting

                      How to know if a Active Directory user can login interactively

                      Refactoring coordinates for Minecraft Pi buildings written in Python