none
Error after open project prepared by Visual studio 2012 by visual studio 2013 "Type 'System.Windows.Forms.DataVisualization.Charting.LineAnnotation' is not defined" RRS feed

  • Question

  • I find the following error Error after open project prepared by Visual studio 2012 by visual studio 2013

    "Type 'System.Windows.Forms.DataVisualization.Charting.LineAnnotation' is not defined"


    Hany Metry

    Thursday, August 23, 2018 1:31 PM

All replies

  • Under project properties, references does the reference in question have a yellow triangle ? 

    Is the reference pointing to say (where the bold part most likely is a different sub-folder) and does it exists?

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Windows.Forms.DataVisualization.dll


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites


    Thursday, August 23, 2018 2:11 PM
    Moderator
  • No the reference in question does not have yellow triangle.

    Most of reference v 4.0 does not exist.


    Hany Metry

    Thursday, August 23, 2018 2:55 PM
  • No the reference in question does not have yellow triangle.

    Most of reference v 4.0 does not exist.


    Hany Metry


    Hi Hany,

    Hope you are well.
     
    What version of the .net framework are you using? 3.5 right?

    What operating system are you on? XP? What os do you target XP and up?

    Your project was working correct? Then something changed and it stopped. What was the change moving to 2013?  Why not 2017?

    Thursday, August 23, 2018 3:46 PM
  • I am using Dot net framework 4.5 for my project and the maximum for 2013 is 4.5.1

    I am using window 7 64 bit.

    copy of built of my project working correct because it built form 2012.

    I changed from 2012 to 2013 because 2013 was the available copy.

    The problem that I reinstall window and then I installed 2013 visual studio but it seems that framework 4.0 was not complete and when I try to install frame work 4.0, it is rejected to be reinstall and said that, more recent version is installed.


    Hany Metry


    • Edited by Hany Metry Thursday, August 23, 2018 4:29 PM modify
    Thursday, August 23, 2018 4:21 PM
  • I am using Dot net framework 4.5 for my project and the maximum for 2013 is 4.5.1

    I am using window 7 64 bit.

    copy of built of my project working correct because it built form 2012.

    I changed from 2012 to 2013 because 2013 was the available copy.

    The problem that I reinstall window and then I installed 2013 visual studio but it seems that framework 4.0 was not complete and when I try to install frame work 4.0, it is rejected to be reinstall and said that, more recent version is installed.


    Hany Metry


    PS Hany Try this first! Just change your project the way it is now to .net 3.5 framework and run it in visual studio 2013.

    Which chart control are you using in your project? The one for .net 3.5 or the one for .net 4.5 ?

    Do you see the chart control in your visual studio 2013 toolbar? Did you install something for chart control or just install 2013?

    "that I reinstall window and then I installed 2013 "


    So you did a new windows 7 install, installed 2013, copied your project folder to the system and now it wont run? Did your project ever run after the windows 7 install?

    "I am using window 7 64 bit."

    I thought you wanted to target XP as well?? If you want xp you should use .net 3.5


    Hmmm. Well I am not sure. But you might have a 3.5 version of the chart control in your project assembly from the old system and it needs .net 3.5. But now you are on .net 4.5 and the control should be a different one.

    I am not sure but maybe you need to remove the chart control you have on your form in your project ie delete it from the form. Then add back a new chart control with same name from the toolbar in vs 2013 to get the new chart control for .net 4 and up.

    Did I say I am not sure???

    Maybe Karen or someone knows for sure??


    https://stackoverflow.com/questions/22846401/visual-studio-2013-and-chart-control-for-net-3-5

    https://www.microsoft.com/en-us/download/details.aspx?id=14422

    The newest visual studio is 2017.


    PS Hany show us an image of your references tab from the properties page of your project.



    Thursday, August 23, 2018 4:43 PM

  • Hany Metry

    Thursday, August 23, 2018 5:02 PM
  • I find form1 which is the first form which appear when run the project without any tools

    Hany Metry

    Thursday, August 23, 2018 5:08 PM

  • Hany Metry

    Thursday, August 23, 2018 5:17 PM
  • I find form1 which is the first form which appear when run the project without any tools

    Hany Metry

    Hany,

    If you don't answer the questions it is hard to help.

    Do you see the chart control in the toolbar of your project now?

    Set your project to use .net 3.5 on the properties application tab.

    Now does it run set to .net 3.5? What errors on the references tab?



    Thursday, August 23, 2018 5:23 PM
  • it does not run to .net 3.5.

    Hany Metry

    Thursday, August 23, 2018 5:48 PM
  • Design-Time Errors in the Windows Forms Designer

    • <time data-article-date-source="ms.date" datetime="2017-03-30T00:00:00.000Z" role="presentation" style="box-sizing:inherit;">03/30/2017</time>
    • 2 minutes to read
    • Contributors
      • dotnet bot 
      • Maira Wenzel 
      • Mike Jones 
      • Matt Hoffman 
      • Luke Latham 
      • all

    This topic explains the meaning and use of the design-time error list that appears in Microsoft Visual Studio when the Windows Forms Designer fails to load. If this error list appears, you should not interpret it as a bug in the designer, but as an aid to correcting errors in your code.

    A basic understanding of this error list will help you debug your applications by providing detailed information about the errors and suggesting possible solutions.


    Hany Metry

    Thursday, August 23, 2018 5:54 PM
  • it does not run to .net 3.5.

    Hany Metry

    Ok lets back up.

    1. Make a new windows form project with 2013. 

    Do you have a chart control in the toolbar?

    What is the .net framework?

    2. Add a chart control to form1 and run the new project.

    Thursday, August 23, 2018 6:03 PM
  • I have not chart control in tool bar for 2013 visual studio.

    Hany Metry

    Thursday, August 23, 2018 8:02 PM
  • I have not chart control in tool bar for 2013 visual studio.

    Hany Metry

    You should be able to make a new project and add a chart.

    When you make the new project select framework 4.5.2

    .

    Next with the form design selected look for the chart control in the toolbox under data:

    Save the project.

    Now look at your other app that wont run and see if you can get the proper chart reference for .net 4.5.2 like the example project.

    Below is the reference for .net 4.5.2 these images are from Visual Studio 2013.

    See the reference path?

    C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.Windows.Forms.DataVisualization.dll

    That is the default project for 2013 so you should be able to do the same with any new win forms project.

    For your large project, check the reference you have. To add the ref Click the add button on the references tab and you get this dialog: select the System.Windows.Forms.DataVisualization.dll by checking it in the add ref dialog (below).

    You may need to remove the bad chart reference you have now in your large project??


    Thursday, August 23, 2018 8:27 PM
  • I have not dot net framework 4.5.2 and the maximum included within my copy of visual studio 2013 is dot net framework 4.5.1

    Hany Metry

    Thursday, August 23, 2018 9:46 PM
  • I have not dot net framework 4.5.2 and the maximum included within my copy of visual studio 2013 is dot net framework 4.5.1

    Hany Metry

    Are you purposely being obtuse?  :)

    Use 4.5.1 then.

    As far as you are concerned I don't think there is any difference in the 4.x. versions. I am just trying to get something to run in your new vs 2013.

    Thursday, August 23, 2018 9:55 PM
  • Yes I have dot net framework 4.5.1 and I have chart for it and I did what you illustrate.  

    Hany Metry

    Thursday, August 23, 2018 10:12 PM
  • Yes I have dot net framework 4.5.1 and I have chart for it and I did what you illustrate.  

    Hany Metry

    Very good.

    LOL.

    Now put a chart control on the form and run it just to be sure.

    Save it.

    Now you can use that new project as an example to follow. See the data visualization reference the chart uses in the references tab of the properties page?

    You should be able to set the path for the chart control correctly in your large project now.

    Set your large project to .net 4.5.1 and then look for the chart in the toolbox? Not there? Go to the reference page and check the chart reference is it the same as the example? Change it.

    If you need to remove the old chart reference. Then add a new chart ref to the project by Clicking the add button on the references tab. Then check the ref in the ref manager dialog.

    Thursday, August 23, 2018 10:25 PM
  • I don't understand the aim of that, visual studio 2013 works correctly but the problem is how to open old version project by visual studio 2013.

    I cant see my old project chart and all the window form which include that chart up till now, how I can correct my project that the problem is I have not old copy 2012.

    If i purchase 2015 or 2017 that will solve the problem?

    Please advice.  


    Hany Metry

    Thursday, August 23, 2018 10:41 PM
  • I don't understand the aim of that, visual studio 2013 works correctly but the problem is how to open old version project by visual studio 2013.

    I cant see my old project chart and all the window form which include that chart up till now, how I can correct my project that the problem is I have not old copy 2012.

    If i purchase 2015 or 2017 that will solve the problem?

    Please advice.  


    Hany Metry

    Hany,

    You created a new project in 2013 and put a chart on it and it runs, correct?

    Now you can follow that new working example project to fix up your old project that does not run.

    Open your old 2012 project solution in 2013.

    Change your old project to .net 4.5.1 if not already.

    Now can you see the chart control in the toolbox of your old project?

    If not go to the properties page references tab and fix up the chart control reference to the correct path for .net 4.5.1 as you just did for the example and as I have shown above.

    You must get the .net version and chart control reference file to match.

    Thursday, August 23, 2018 10:53 PM
  • If i purchase 2015 or 2017 that will solve the problem?

    Please advice.  


    Hany Metry

    Those versions 2017 are free for the community version.

    No you will still have to set the .net version correctly and possibly the chart control reference as explained.

    PS that is my guess.

    You should just try with 2013 as I have shown you.

    Thursday, August 23, 2018 10:55 PM