locked
Need my app work on PC with .NET 4.0 also. RRS feed

  • Question

  • Hello friends,

       I have couple of applciations in a single application that was developed using .NET3.5. The application doesn't work at all on PC with .NET4.0.

       To know the uncompatibility, I set the framework of the project as Net4.0, changed <supportedRuntime> to 4.0 from 2.0, and compiled my files. All files got compiled without a single error. This tells me that hte app is compatible with .Net4.0 also. I user certificates and tap adapter in my app.

       Then the point is:

    Why it doesn't run on the PC with .Net 4.0 ?

    I change the <supportedRuntime> element to 4.0, so this version wont be compatible with 3.5, I guess. So I should have different versions for <= 3.5 & >= 4.0 net versions ?

    No errors/warnings means full code is compatible according to my understandings. Can anyone help me know what should I do and how to handle the problem ? Please guide me for the same.

    On debugging I found that it fails on line :

    System.Net.ServicePointManager.Expect100Continue = true;

    And the app stops. MSDN says that Expect100Continue is supported, then y ServicePointManager not acepting it. I also read that it was a mistake (not supporting Expect100Continue in net4). http://msdn.microsoft.com/en-us/library/system.net.servicepointmanager.expect100continue(v=vs.100).aspx

    http://stackoverflow.com/questions/13317498/expect100continue-in-net-4-5

    Thanks


    Thanks
    If you find any answer helpful, then click "Vote As Helpful" and if it also solves your question then also click "Mark As Answer".


    • Edited by truptivd Friday, February 22, 2013 10:16 AM Debug Results
    Friday, February 22, 2013 8:59 AM

Answers

  • Hi Truptivd,

    Welcome to the MSDN Forum.

    When you want to upgrade the .net framework version. You can just change the .net framework to 4.0 and remove the certificate and add it again on the project property page again. There is no necessary to use the supportedRuntime config.

    Based on your second post, the valid version value is: http://msdn.microsoft.com/en-us/library/w4atty68.aspx

    A string value that specifies the version of the common language runtime (CLR) that this application supports. The first three versions of the CLR are specified by "v1.0.3705", "v1.1.4322", and "v2.0.50727". Beginning with the .NET Framework 4, only the major and minor version numbers are required (that is, "v4.0" instead of "v4.0.30319"). The shorter string is recommended.

    There is no 2.0,3.0,3.5.

    If you still have any issues, please feel free to follow up.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    • Edited by Mike Feng Monday, February 25, 2013 11:54 AM
    • Marked as answer by Mike Feng Thursday, February 28, 2013 1:58 PM
    Monday, February 25, 2013 11:30 AM

All replies

  • Phew...

    Some twists .Net4 makes & requires.

    1) Commented on Expect100Continue stmt.

    2) On changing the target to 4.0, <supportedRuntime> element was added under startup at start in app.config file. I had couple of userSettings too added in it. <startup> was the 1st child of <configuration>; whereas <confgSections> should be the very 1st child of <configuration>. So, moved <startup> after completion of <confgSections>, and replaced version in it with 2.0.0.0 with 4.0.0.0.

    This got my application started. Still am facing problem with Verifing the Certificate installed by the app, and make Expect100Continue Stmt work.

    The same crt filw was working perfectly in 3.5. Now the file shows as "Blocked", if I unblock it, it shows the digital Signature is invalid.


    Thanks
    If you find any answer helpful, then click "Vote As Helpful" and if it also solves your question then also click "Mark As Answer".

    Friday, February 22, 2013 11:29 AM
  • Hello Friends,

    I have a set of applications as a single Project developed in C# using .NET3.5.   The app doesn't work in PC with NET4, I migrated and testing to see all functionality is working in NET4 or not. Changed the Net framework to 4.0 instead of 3.5.

    The same apps got compiled & build without a single error in NET4. The app contains UserSettings in Properties.Settings. I changed the version in  to 4.0.0 from 2.0.0 and now app starts its execution.

    My QUESTIONs:

    1) I believe the code is compatible for NET3.5 & 4.0, as 3.5 code got compiled in 4.0 without a single error/warning. But the only problem lies at present is value of Version in configSections tag in appConfig will be different for version with .NET3.5 & .NET4.0. Is their anyway, I can use the same code for NET3.5 & 4 in addition to handle the above mentioned situation i.e. value of Version tag ?  

     2) Can I add

      <startup>
    <!-- FOR .NET 3.0 & 3.5, 3.0.50727 CLR is only used -->
    
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    <supportedRuntime version="v2.0" />  <!-- For Net 2.0, 3.0, 3.5 -->

      to make the app run on PC with NET 4.0 or 3.5 ? If I don't add the "v2.0" line, then this app will run in NET 3.5 or lower ? I guess No. And if NET 4.0, is avbl then to make the app run I got to mention version="v4.0".

    Any help, guidance is appreciated.


    Thanks
    If you find any answer helpful, then click "Vote As Helpful" and if it also solves your question then also click "Mark As Answer".

    • Merged by Mike Feng Monday, February 25, 2013 11:49 AM duplicate
    Friday, February 22, 2013 1:07 PM
  • Hi Truptivd,

    Welcome to the MSDN Forum.

    When you want to upgrade the .net framework version. You can just change the .net framework to 4.0 and remove the certificate and add it again on the project property page again. There is no necessary to use the supportedRuntime config.

    Based on your second post, the valid version value is: http://msdn.microsoft.com/en-us/library/w4atty68.aspx

    A string value that specifies the version of the common language runtime (CLR) that this application supports. The first three versions of the CLR are specified by "v1.0.3705", "v1.1.4322", and "v2.0.50727". Beginning with the .NET Framework 4, only the major and minor version numbers are required (that is, "v4.0" instead of "v4.0.30319"). The shorter string is recommended.

    There is no 2.0,3.0,3.5.

    If you still have any issues, please feel free to follow up.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    • Edited by Mike Feng Monday, February 25, 2013 11:54 AM
    • Marked as answer by Mike Feng Thursday, February 28, 2013 1:58 PM
    Monday, February 25, 2013 11:30 AM