locked
Duplicate Application.Designer.vb files RRS feed

  • Question

  • Hello,

       I don't know what I may have clicked on but, in Solution Explorer under My Project, there are now duplicates of Application.Designer.vb under Application.myapp. One is named Application.Designer.vb and the other is named Application1.Designer.vb. If I comment out the code on one of them them build works without errors.

        However, if I delete one of them, I get a warning "The custom tool Application.Designer.vb failed while processing the file 'My Project.Application.myapp." but it still builds.

        If I click on the warning, a messsage window appears with "The last attempt to run the custom tool 'My Project.Application.myapp' failed. Would you like to re-run the custom tool?" If I click NO, the program builds. If I click YES, it adds the duplicate Application1.Designer.vb again the the errors are back.

    I am running VB.net 2008. Can you tell me how to eliminate the errors and the warning?

    Thank you,

    Dan

    Friday, October 29, 2010 3:34 PM

Answers

  • I ran into the same problem.  It seems that for some reason the application.designer.vb file is locked, so it adds a new file, with a number appended to application.  So now you have duplicate code, but if you delete the duplicate code you now get an error.  I fixed the issue by going into the <projectname>.vbproj file (used notepad) and removed the duplicate file names in the compile include nodes.  Then you can remove the duplicate code, build the project and you should be good to go.  Hope this helps.

    Wade

    P.S. Here is what the xml nodes look like.

    Keep

        <Compile Include="My Project\Application.Designer.vb">
          <AutoGen>True</AutoGen>
          <DependentUpon>Application.myapp</DependentUpon>
        </Compile>

    Remove any like this

        <Compile Include="My Project\Application1.Designer.vb">
          <AutoGen>True</AutoGen>
          <DependentUpon>Application.myapp</DependentUpon>
        </Compile>


    http://blogs.windowsclient.net/wwade73/
    • Marked as answer by DanFSD Tuesday, January 3, 2012 2:40 PM
    Tuesday, January 3, 2012 1:36 PM

All replies

  • Is the content the same in both files?


    Matt Kleinwaks - MSMVP MSDN Forums Moderator - www.zerosandtheone.com
    Friday, October 29, 2010 3:35 PM
  • Hello DanFSD,

    Thanks for your post.

    As kleinma asked, are you sure the code on them is the same? You could try to create a new project and copy the existed code. Does the same scenario occur?

    Best regards,
    Liliane
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. Thanks
    Thursday, November 4, 2010 8:02 AM
  • Hello,

    Sorry I didn't get back to you sooner but I did get a notice that there was a respose to me question. I believe that both of them are the same and that would explain why one of them just has a number 1 added to the word "Application" in the file name.

    Thursday, November 4, 2010 9:47 PM
  • I have the same problem. It keeps generating a new one because "The file is currently being used by another process". What I'm looking for is how to single out the code that requests for every one of these files. I currently have up to application4.designer.vb, and if I delete any other one the build fails. Cleaning doesn't work, nor does rebuilding. I've tried to move all the files into a new project except for the "My project", "Bin", and "obj" folders. Same thing happens. And it appears that everytime I make a build, it updates 2 of the designers - the new one and one of the old ones. Then it gets an error. etc.
    Sunday, March 6, 2011 9:15 AM
  • Same problem here with my Windows Form project. 

    I switched the project from targeted .net 3.5 to .net 4.0.  It automatically generated a Application1.Designer.vb file.  If I delete both Application.Designer.vb and Application1.Designer.vb files, it will complain that there is no Startup form.  And go back to the project property Application tab, the Startup Form is set over there.  I will have to change the startup form to other form and change back to the original form.  But this way it will generate Application1.Designer.vb.  Notice that this time, I do not have Application.designer.vb file at all before it create the new Application1.designer.vb file.  It compiled OK.  But it is annoying.  Something is not right here. 

    Any idea? 

    • Proposed as answer by Wade73 Tuesday, January 3, 2012 1:30 PM
    • Unproposed as answer by Wade73 Tuesday, January 3, 2012 1:30 PM
    Thursday, June 16, 2011 9:01 PM
  • I ran into the same problem.  It seems that for some reason the application.designer.vb file is locked, so it adds a new file, with a number appended to application.  So now you have duplicate code, but if you delete the duplicate code you now get an error.  I fixed the issue by going into the <projectname>.vbproj file (used notepad) and removed the duplicate file names in the compile include nodes.  Then you can remove the duplicate code, build the project and you should be good to go.  Hope this helps.

    Wade

    P.S. Here is what the xml nodes look like.

    Keep

        <Compile Include="My Project\Application.Designer.vb">
          <AutoGen>True</AutoGen>
          <DependentUpon>Application.myapp</DependentUpon>
        </Compile>

    Remove any like this

        <Compile Include="My Project\Application1.Designer.vb">
          <AutoGen>True</AutoGen>
          <DependentUpon>Application.myapp</DependentUpon>
        </Compile>


    http://blogs.windowsclient.net/wwade73/
    • Marked as answer by DanFSD Tuesday, January 3, 2012 2:40 PM
    Tuesday, January 3, 2012 1:36 PM
  •   Notice that this time, I do not have Application.designer.vb file at all before it create the new Application1.designer.vb file.  It compiled OK.  But it is annoying.  Something is not right here. 

    Any idea? 

    Hi Wade73

    I faced the same problem with typed-dataset designer.vb, what I did was I delete the file from the project, and delete it from the folder, when I re-compile, it comes back

    The solution I got is I right-click on the project >> Edit Project and the VS open the project as XML, then I searched for text (as in your case for "Application1.Designer.vb") and I delete it is complete XML TAG. That prevent the project from generate it again.

    hth


    Tuesday, January 3, 2012 2:13 PM
  • Came across this issue and your solution worked perfectly. Thanks!
    Tuesday, March 11, 2014 6:55 PM