none
Issue converting from vs2008 to vs2010

    Domanda

  • Hi Folks,

    I am trying to convert a vs2008 solution to vs2010. When I open the solution in vs2010 it goes to a conversion process which seems to be OK. However there are no files in my solution explorer to work with. If I restart vs2010 and try to load my solution I get the following error.

    ________________________________________________________________________________________

    C:\MyFolder\MySolution.vbproj(802,3) : error  
    : Unable to read the project file 'MySolution.vbproj'.

    C:\MyFolder\MySolution.vbproj(802,3):
    The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.Office2007.
    targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

    ___________________________________________________________________________________________

    I have Office 2007 installed on my PC and I am developing an Excel addin in vs.

    Can anyone assist in getting up and running?

    Thanks Bernie


    Bernie


    • Modificato Bernie Ok lunedì 16 aprile 2012 20:13
    lunedì 16 aprile 2012 20:12

Risposte

  • Hi Bernie,

    The objective is to get the conversion wizard to find the project from 2008 and convert it to 2010. The problem is that the wizard is looking for "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.Office2007.
    targets" The strategy is to give it that folder. The concern is that by pursuing the strategy you mess things up so the approach is to copy every component of the original project to a safe place, then change the name of the "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets" to "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.Office2007.targets".

    I don't know the contents of the .targets folder you do have. You can explore and determine whether those have anything to do with the project you want to convert. If so - for the sake of having a backup, copy those files to a backup folder somewhere. Remember its name so you can find it again if you need to fall-back. If the contents have nothing to do with the project you want to convert determine how they got there and whether they result from some earlier conversion. Do they need to be preserved? You decide.

    Next - add a folder to the folder at "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\OfficeTools\Microsoft.VisualStudio.Tools.Office" named "Office 2007". Then add a folder to that one named "targets".

    If the existing contents of "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets" are relevant to this conversion copy them and paste them into the new folder at  "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.Office2007.targets".

    If the existing contents of the folder you do have on your system are not relevant then the new folder will be empty. Run the Wizard again. At least the message will either go away, or it will say something to the effect that the expected folders or files aren't found.

    Review the original messages you saw when you first had the problem. The wzard said it was "Unable to read the project file 'MySolution.vbproj'. "  On further exploration it said it couldn't find the ....\Office 2007.targets folder. If you have put the tree "MySolution.vbproj" file or folder in the new ....\Office 2007.targets folder you may have resolved the problem. If not you will have preserved in temporary folders what you need to use in falling back to the beginning.

    At that point the last approach you might consider is to rebuild a new VS2010 VSTO add-in solution containing the logic of the one you can't convert. Beyond that you will need to consider opening a paid support incident with Microsoft Customer Support Services.

    Please visit the link below to see the various paid support options that are available
    to better meet your needs.
    http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone


    Please remember to mark the replies as answer if they help and unmark them if the provide no help. and click "Vote as Helpful" this and other helpful posts, so other users will see your thread as useful. Chris Jensen

    • Contrassegnato come risposta Bernie Ok lunedì 30 aprile 2012 23:33
    lunedì 30 aprile 2012 14:29
    Moderatore

Tutte le risposte

  • Hi Bernie,

    Thanks for posting in the MSDN Forum.

    Would you please delet the *.suo file then convert it again. Let's see whether it can help you.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    mercoledì 18 aprile 2012 05:25
    Moderatore
  • Hi Tom,

    Thank you for the reply. I go through the following steps.

    - I start with a ‘clean’ copy of my solution developed in VS2008.

    - I delete the .suo file.

    - I then start VS2010 and load the solution.

    - I go through the conversion process.

    - The conversion report reports some errors. When I look at the solution explorer it tells me the solution is unavailable.

     

    I am wondering if this problem may be related to the fact that I downloaded and installed VS2012 beta before I purchased VS2010 and installed it. If I do need to uninstall VS2012 beta then a reference to how I can do this would be helpful. Any other advice is much appreciated.

    Many Thanks,

    Bernie

    Bernie


    • Modificato Bernie Ok mercoledì 18 aprile 2012 08:52
    mercoledì 18 aprile 2012 07:39
  • Hi Bernie,

    Ok, I will involve some experts into this thead tho see whether they can help you. There might some time delay, thanks for your patience.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    giovedì 19 aprile 2012 07:04
    Moderatore
  • Hi Bernie,

    Here are links to content on removing the beta(s) of VS 2010:


    how to upgrade visual studio 2010 Beta 2
    http://social.msdn.microsoft.com/Forums/en/vssetup/thread/123c1302-d644-43e4-93e7-a8abe3699116

    Important uninstall instructions for migrating from the .NET ...
    http://blogs.msdn.com/b/astebner/archive/2009/10/19/9909489.aspx


    How do I migrate VS 2010 Beta 1 models into VS 2010 Beta 2
    http://social.msdn.microsoft.com/Forums/en-US/vsarch/thread/d42bc6e1-a97e-4e1e-8d89-5248d014b9c9

    Enabling Code Coverage in VS 2010 Beta 2 - Microsoft UK Developer ...
    http://blogs.msdn.com/b/ukvsts/archive/2009/11/06/enabling-code-coverage-in-vs-2010-beta-2.aspx

    If nothing in the above helps would you give us spcifics regarding the precise wording of the message you see when you learn the 'solution is unavailable,' what the Conversion Report error log contains, what happens if you do not delete the .suo file first, and whether your project is under a version control system such as SourceSafe. Also, can you convert any other VS project successfully.  Thanks.
    Regards,
    Chris Jensen


    Chris Jensen

    lunedì 23 aprile 2012 19:20
    Moderatore
  • Thank you for replying Chris,

    In think that you may have misunderstood part of my question. I do not have vs2010 beta installed. I initially had VS 2008 installed and working fine. I then installed vs2012 beta. Later I purchase vs2010 professional. I cannot get vs2010 professional working properly. Since then I have tried to uninstall vs2012 beta from the control panel (I am not sure that I did this correctly!). VS2008 is still working fine. I go through the following steps.

    1. I start vs2010
    2. I try to load a vs2008 solution with the *.suo file removed
    3. The conversion wizard starts and an error occurs with the message:

     Unable to read the project file 'MyAddin.vbproj'. C:\My Stuff\MyAddin.vbproj(796,3): The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.Office2007.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

    4. I  then look inside of folder C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\OfficeTools\  and find that the file ‘Microsoft.VisualStudio.Tools.Office.Office2007.targets’ does not exist. But there is a file called ‘Microsoft.VisualStudio.Tools.Office.targets’.

     5. I still have the same problem even if the .suo is present.

    6. I don't know anything about SourceSafe!!!!

    7. Finally, I was able to convert another solution which was a simple windows form with some code.

    I would much appreciate any assistance.

    Regards,

    Bernie


    Bernie


    • Modificato Bernie Ok lunedì 23 aprile 2012 23:56
    lunedì 23 aprile 2012 23:43
  • Hi Bernie,
    Please see the following content:
    - Visual Studio Conversion Wizard changing project file to point to ...
    http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/ca71585b-6b85-4218-9f4a-888037af126f

    Chris Jensen

    mercoledì 25 aprile 2012 14:19
    Moderatore
  • Thankyou Chris,

    I looked at the page you suggested but unfortunately it did not help. I opened the Project Upgrade dialog box and then cleared the Always upgrade to installed version of Office option. However I still get the same error as outlined earlier.Thanks,

    Bernie


    Bernie

    giovedì 26 aprile 2012 00:17
  • Hi Bernie,

    You may have already looked at the MSDN article below, since you followed the site I suggested in my last post - that page also refers to this content: 
    Upgrading and Migrating Office Solutions - MSDN – Explore ...
    http://msdn.microsoft.com/en-us/library/k2xkefex.aspx

    Other references are:
    - Upgrading VSTO Projects to use with Visual Studio 2010 (Navneet ...
    http://blogs.msdn.com/b/vsto/archive/2010/04/15/upgrading-vsto-projects-to-use-with-visual-studio-2010-navneet-gupta.aspx

    Version-Specific UI in Add-ins - Andrew Whitechapel - Site Home - MSDN Blogs:
    http://blogs.msdn.com/b/andreww/archive/2008/09/02/version-specific-ui-in-add-ins.aspx

    - Visual Studio Tools for Office Runtime Overview
    http://msdn.microsoft.com/en-us/library/bb608603.aspx

    - Project Upgrade, Options Dialog Box - MSDN – Explore Windows ...
    http://msdn.microsoft.com/en-us/library/bb625070.aspx

    - Migrating Office Solutions to the .NET Framework 4
    http://msdn.microsoft.com/en-us/library/ee207231.aspx

    - How to: Upgrade Office Solutions - MSDN – Explore Windows, Web ...
    http://msdn.microsoft.com/en-us/library/4bez6837.aspx

    If nothing in those articles clarifies your situation a desparate step (with no guaranty of success) is to uninstall and re-install Visual Studio 2010.


    Chris Jensen

    giovedì 26 aprile 2012 16:11
    Moderatore
  • Hi Chris,

    I looked at the pages that you suggest but none seem to directly address my issue (but I don't claim to have understood all that I read). I took the step of uninstalling and then reinstalling VS2010. However I still get the same problem.

    Thanks,

    Bernie


    Bernie

    giovedì 26 aprile 2012 20:29
  • Hi Bernie,

    You're a man with great patience. There isn't anthing I can find that parallels your problem.  Do you have two collections of folders. one with the path
    C:\Program Files (x86)\
    and one with the path
    C:\Program Files\
    ?
    If so please compare the contents to see whether your conversion files are in both, or in the wrong one. Perhaps at some point the wrong path got written to a registry key.

    When you use the Conversion Wizard do you browse to the folder holding the VS 2008 project and open it - because the error message says that the path in the <import> declaration might be incorrect or the file may be missing. Maybe the conversion Wizard isn't perfect. If that's the case you  may workaround the issue by adapting the path to the old project to match what the Wizard wants.

    So please consider this:
    1. make a new folder named Temporary Backup.
    2. Copy every folder and file out of the project folder for the original VS 2008 Solution.  Make a note of that folder's name. It should be something like
         C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.Office2007\<some folder name>
    3. Make a note of the contents of ...Microsoft.VisualStudio.Tools.Office.targets’ If it is on the same path as the missing folder, and has the same sub-folders and files as the original VS 2008 solution rename it to "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.Office2007.targets"
    4. Run the Conversion Wizard again.

    Please let us know if this resolves  your problem.  If it doesn't resolve the issue please restore the folders and files to their original names, paths and contents.  If it works you can delete the Temporary Backup folder (this is optional.)


    Please remember to mark the replies as answer if they help and unmark them if the provide no help. and click "Vote as Helpful" this and other helpful posts, so other users will see your thread as useful. Chris Jensen

    venerdì 27 aprile 2012 20:38
    Moderatore
  • Thanks Chris,

    Firstly, 'C:\Program Files\' doesn't contain folder 'C:\Program Files\MSBuild\Microsoft\VisualStudio\'.

    But the C:\Program Files (x86)\ does contain 'C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\OfficeTools\'.

    The only file this folder contains is 'Microsoft.VisualStudio.Tools.Office.targets',  created well over a year ago.

    It does NOT contain 'Microsoft.VisualStudio.Tools.Office.Office2007.targets'.

    Now I found your instructions a bit confusing.
    1. make a new folder named Temporary Backup. <No problem>
    2. Copy every folder and file out of the project folder for the original VS 2008 Solution. 
    <I assume to folder Temporary Backup>
    Make a note of that folder's name.
    <I assumed it was Temporary Backup>

    It should be something like
         C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.Office2007\<some folder name>

    At this point I am confused. Could you please clarify.

    Thankyou for your perseverence,
    Bernie


    Bernie


    • Modificato Bernie Ok sabato 28 aprile 2012 04:29
    sabato 28 aprile 2012 04:29
  • Hi Bernie,

    The objective is to get the conversion wizard to find the project from 2008 and convert it to 2010. The problem is that the wizard is looking for "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.Office2007.
    targets" The strategy is to give it that folder. The concern is that by pursuing the strategy you mess things up so the approach is to copy every component of the original project to a safe place, then change the name of the "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets" to "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.Office2007.targets".

    I don't know the contents of the .targets folder you do have. You can explore and determine whether those have anything to do with the project you want to convert. If so - for the sake of having a backup, copy those files to a backup folder somewhere. Remember its name so you can find it again if you need to fall-back. If the contents have nothing to do with the project you want to convert determine how they got there and whether they result from some earlier conversion. Do they need to be preserved? You decide.

    Next - add a folder to the folder at "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\OfficeTools\Microsoft.VisualStudio.Tools.Office" named "Office 2007". Then add a folder to that one named "targets".

    If the existing contents of "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets" are relevant to this conversion copy them and paste them into the new folder at  "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.Office2007.targets".

    If the existing contents of the folder you do have on your system are not relevant then the new folder will be empty. Run the Wizard again. At least the message will either go away, or it will say something to the effect that the expected folders or files aren't found.

    Review the original messages you saw when you first had the problem. The wzard said it was "Unable to read the project file 'MySolution.vbproj'. "  On further exploration it said it couldn't find the ....\Office 2007.targets folder. If you have put the tree "MySolution.vbproj" file or folder in the new ....\Office 2007.targets folder you may have resolved the problem. If not you will have preserved in temporary folders what you need to use in falling back to the beginning.

    At that point the last approach you might consider is to rebuild a new VS2010 VSTO add-in solution containing the logic of the one you can't convert. Beyond that you will need to consider opening a paid support incident with Microsoft Customer Support Services.

    Please visit the link below to see the various paid support options that are available
    to better meet your needs.
    http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone


    Please remember to mark the replies as answer if they help and unmark them if the provide no help. and click "Vote as Helpful" this and other helpful posts, so other users will see your thread as useful. Chris Jensen

    • Contrassegnato come risposta Bernie Ok lunedì 30 aprile 2012 23:33
    lunedì 30 aprile 2012 14:29
    Moderatore
  • Hi Chris,

    I followed your suggestions and can now load my solution into VS2010 but I cannot build it. I this stage I am ready for some radical solutions. I carn't help suspecting that my installation of VS2012 beta is somehow part of the problem. One solution is to start from scratch, that is format the hard drive and start again with a clean slate. I wish to thank you for the considerable time and effort that you have put in to resolve this issue.

    Best,

    Bernie


    Bernie

    • Proposto come risposta DanielLang giovedì 23 agosto 2012 18:01
    lunedì 30 aprile 2012 23:33
  • Sorry, but there's a whole lot of nonsense in your answer.

    1) You're repeatedly talking about a folder. However, the error message clearly talks about a .target file that is missing. These MSBuild targets are a well-known thing for most developers. Unfortunately it seems that you didn't even open the corresponding directory on your machine before writing the answer, otherwise you would have known that we're talking about a file with a .targets extension here.

    2) It has to do with VS2012. Bernie Ok gave the hint several times, but you ignored it. I can reproduce this bug very quickly on a virtual machine and show that the conversion from Visual Studio 9 to 10 fails after 11 has been installed. You could argue that it's one own fault if he installs a Beta version, however, I can show you this with the final version of VS2012.

    All this wouldn't be a problem if you weren't a Microsoft employee providing a link to paid support to someone who probably already has paid thousands for his MSDN subscription. In my opinion, every person answering a question - and especially a Microsoft guy/gal - should at least dedicate a minimum amount of time before answering. We've already paid enough to get this kind of support.

    giovedì 23 agosto 2012 17:59