c# change framework error

后端 未结 4 1530
一生所求
一生所求 2021-01-13 03:28

I am running Visual Studio 2010. I just change the frame work of my project from 4.0 to 3.5. I removed the reference Microsoft.Framework that it asked me to remove then trie

相关标签:
4条回答
  • 2021-01-13 03:46

    I ran into a Visual Studio bug that caused me a similar problem. I used this workaround to solve it:

    A fix that SEEMS to work is to manually alter one character in the image stream EVERY TIME the usercontrol or form is edited in the designer

    <data name="icons_20.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
        <value>
         AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
    

    Change to

         AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
    

    That is 00LjAuMC4w back to 0yLjAuMC4w at the end of the line (00 back to 0y)

    But I have to fix that every time I change something in that form.

    0 讨论(0)
  • 2021-01-13 03:58

    You can try regenerating the file by right-clicking the .resx file and choosing 'Run Custom Tool' from the context menu.

    Edit: before you do this, change the Access Modifier or add a new value to force a regeneration.

    Another edit: See Downgrade an application from .net 4.0 to 3.5 for another possibility

    0 讨论(0)
  • 2021-01-13 04:00

    Having this problem for a long time, i lost hope that microsoft fix this bug ever. Then i begin use manual written code for handle pictures contains in resources:

    string resource = "Company.Namespace.Resources.picture.gif";
    pictureBox1.Image = new Bitmap(Assembly.GetExecutingAssembly()
    .GetManifestResourceStream(resource));
    

    Dot forget to set property "Build action" of picture.gif to "Embeded resource"

    0 讨论(0)
  • 2021-01-13 04:02

    Not sure about this, but since the other answers didn't help, try this. The Version=4.0.0.0 in your file is telling the compiler to use .net 4.0 assemblies. Try changing them to Version=3.5.0.0 or Version=2.0.0.0 and see if that solves it.

    0 讨论(0)
提交回复
热议问题