locked
Whether 4.5.1 and 4.6 .NET framework assemblies required for development? RRS feed

  • Question

  • Hi All,

    As we all know that Microsoft has released Visual Studio 2013 and Visual Studio 2015. So, i started to develop an user library in framework version 4.5.1 (VS2013) and 4.6(VS2015).  Now, I want to know that whether do we need to create user controls in .NET framework 4.5.1 and 4.6 for development(Configuring Visual Studio toolbox and then for development)? Else, we can use the user controls created in 4.5 .NET framework in VS2013 and VS2015 for development? If not needed, kindly provide the reason for the same.

    Please provide your valuable suggestions on this.

    Regards,

    Vadivel



    Vadivel Natarajan


    • Edited by VadivelNKL Wednesday, October 14, 2015 9:21 AM
    Wednesday, October 14, 2015 9:19 AM

Answers

  • Why would you not just target everything for 4.6 and obviate any issue?

    Having said that, you should be able to create a control library and compile for 4.5.1 and it still works for 4.6. Or the reverse.

    I guess your issue is something to do adding to the toolbox.

    You somehow specify a particular framework version requirement on assemblies.

    Personally, when I re-use control libraries I don't bother with the toolbox.

    I avoid chains of dependencies from any control library.


    Hope that helps.

    Technet articles: WPF: MVVM Step 1; All my Technet Articles

    Wednesday, October 14, 2015 10:57 AM
  • >>Else, we can use the user controls created in 4.5 .NET framework in VS2013 and VS2015 for development?

    Yes.

    You don't need to recompile an assembly built against the .NET Framework 4.5 in order to be able to use it in an application that is built against a later version of the .NET Framework (such as 4.5.1 or 4.6). The .NET Framework tries to maximize backward compatibility. Please refer to the documentation on MSDN for more information about this:

    Version Compatibility in the .NET Framework: https://msdn.microsoft.com/en-us/library/ff602939%28v=vs.110%29.aspx


    Hope that helps


    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't ask several questions in the same thread.

    Thursday, October 15, 2015 11:03 AM

All replies

  • Hi ,

    In VS 2015 projects(say WPF), if I drag and drop our control(not Microsoft .net control) from toolbox, the main control alone has referred the .NET 4.6 framework dll. All the other dependent assemblies are referring .NET 4.5.1 assemblies instead of .NET 4.6 Framework.

    To refer the proper .NET Framework version in projects, we made the entry in following  registry location based on framework.

    .NET Framework 4.6 à HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.5.23026\AssemblyFoldersEx\SES4.6

    .NET Framework 4.5.1 à HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.5.1\AssemblyFoldersEx\SES4.5.1

    Could anyone please help on this to get this error resolved?

    PS: Please let us know where we missed to put the registry entry for .NET Framework 4.6 framework and do recommend us all possible solutions to try at our end.

    Regards,

    Vadivel


    Vadivel Natarajan

    • Merged by Xavier Xie-MSFT Thursday, November 5, 2015 10:03 AM the same issue
    Monday, October 12, 2015 10:59 AM
  • Why and how does your control reference a framework version at all?

    Or do you mean it references some other dll and you have specified the version to use?

    Or what?

    And where does it change what when you drag and drop?

    If you drag and drop a button or something I wouldn't expect that to add or remove referenced dll.


    Hope that helps.

    Technet articles: WPF: MVVM Step 1; All my Technet Articles

    Monday, October 12, 2015 11:46 AM
  • Hi,

    We built all our assemblies based on frameworks, maintain it in separate folders, and then configured it in Visual Studio. So, if I drag and drop a ‘Grid control’ in a designer page of a project with target framework as 4.6, all the dependency assemblies of the ‘Grid Control’ will be added under reference section with the assembly version related to 4.5.1 instead of assembly version related to 4.6 framework.

    To be clear, see below

                    Grid Control assembly version - 1.46.0.1 (4.6 framework)

                    Dependent control assembly version – 1.451.0.1 (4.5.1 framework)

    Instead of referring the 4.6 framework assembly from the respective path as per the registry entry (see my above thread) we made it for assembly reference, project referring 4.5.1 framework assemblies.  We need to fix this. This is an very high priority one.

    Could anyone please help on this to proceed further?

    Regards,

    Vadivel 


    Vadivel Natarajan

    Tuesday, October 13, 2015 2:27 AM
  • Hi,

    As far as I know, you could add .net 4.5 dll and .net4.6 dll reference for your project in WPF.

    For example, you could create a usercontrol library in .net4.5 target framework, then you could add this dll reference in your .net 4.6 target framework project.

    Tuesday, October 13, 2015 3:35 AM
  • Hi,

    Thanks for your replies. 

    But, my scenario is i need to use the usercontrol library we created in 4.6 framework in VS2015 project.

    In this, am facing the above reported assembly reference issue even though i set the reference path in registry to refer the library we created in 4.6 framework.

    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.5.23026\AssemblyFoldersEx\SES4.6

    Could anyone please provide your valuable suggestion to resolve this? That will help us to proceed further.





    Vadivel Natarajan

    Tuesday, October 13, 2015 10:19 AM
  • Would anyone please update on this?

    Vadivel Natarajan

    Tuesday, October 13, 2015 12:04 PM
  • Why would you not just target everything for 4.6 and obviate any issue?

    Having said that, you should be able to create a control library and compile for 4.5.1 and it still works for 4.6. Or the reverse.

    I guess your issue is something to do adding to the toolbox.

    You somehow specify a particular framework version requirement on assemblies.

    Personally, when I re-use control libraries I don't bother with the toolbox.

    I avoid chains of dependencies from any control library.


    Hope that helps.

    Technet articles: WPF: MVVM Step 1; All my Technet Articles

    Wednesday, October 14, 2015 10:57 AM
  • >>Else, we can use the user controls created in 4.5 .NET framework in VS2013 and VS2015 for development?

    Yes.

    You don't need to recompile an assembly built against the .NET Framework 4.5 in order to be able to use it in an application that is built against a later version of the .NET Framework (such as 4.5.1 or 4.6). The .NET Framework tries to maximize backward compatibility. Please refer to the documentation on MSDN for more information about this:

    Version Compatibility in the .NET Framework: https://msdn.microsoft.com/en-us/library/ff602939%28v=vs.110%29.aspx


    Hope that helps


    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't ask several questions in the same thread.

    Thursday, October 15, 2015 11:03 AM
  • Hi All,

    I am working on a WPF application using Visual Studio 2015 with target framework as 4.6. For developing, am using an user controls created in .NET 4.6 framework(configured the developed user controls in Visual Studio 2015 toolbox, and then drag and drop the required user controls in the designer page for my development). After drag and drop the user controls in designer page, all the required controls added as reference under section. Then I checked the version for all the added assemblies and found that main control alone showing the framework version 4.6(1.0460.0.1) and the rest of the controls (dependent controls) showing the framework version 4.5.1 (1.0451.0.1).

    i)

          Showing proper version as .NET Framework 4.6

    ii) 

       Showing wrong framework version (.NET Framework 4.5.1)

    To refer the proper .NET Framework version in a Visual Studio 2015 project, we made the entry in following registry location based on framework and set the assemblies path.

    .NET Framework 4.6 ---> HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.5.23026\AssemblyFoldersEx\SES4.6

    .NET Framework 4.5.1 -à HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.5.1\AssemblyFoldersEx\SES4.5.1

    Please find below the screenshot for your reference. 

    Registry for both .NET framework 4.5.1 and 4.6

    Still assembly version mismatch issue occurs.  Could anyone please help on this to get this error resolved? Also please point out if anything we missed to make the entry in registry.

    Note: We have created project using Visual Studio 2013 with target framework as 4.5.1. In that, no assembly version issue we faced. 


    Please let me know if you have any questions. Thanks in advance !!


    Regards,

    Vadivel


    Vadivel Natarajan



    • Edited by VadivelNKL Friday, October 16, 2015 9:43 AM
    • Merged by Xavier Xie-MSFT Monday, October 19, 2015 2:55 AM the same question
    Friday, October 16, 2015 9:42 AM
  • Hi VadivelNKL,

    >>” To refer the proper .NET Framework version in a Visual Studio 2015 project“

    I have saw that you have posted several similar thread in WPF forum, please don’t post multi repeat question, I would merge it.

    Thank you for your understanding.

    Best Regards,

    Xavier Eoro


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, October 19, 2015 2:54 AM
  • Hi Xavier,

    Since i didn't get proper solution for my query posted, i have started a new thread with more details of my query.

    Regret for the inconvenience.

    Please anyone help me on this to resolve that error?

    Regards,

    Vadivel


    Vadivel Natarajan

    Tuesday, October 20, 2015 4:12 AM
  • Hi VadivelNKL,

    I’m agree with Andy and Magnus’s points, if you use your control (4.5.1) in your project which’s framework target was .net 4.6, in my experience, it could work well. You could add dll (4.5) in your project and use it.

    Here, I might not understand your question clearly. Why have you made entry in registry? You could add reference directly.

    You could record some “.gif” picture to describe your question.

    Best Regards,

    Xavier Eoro


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, October 20, 2015 7:47 AM
  • I also wonder why any registry entry at all.

    That shouldn't be necessary.

    Like I said, I think it's the code which is related to dragging and dragging your control onto the design surface that must be the problem.

    That is adding the reference to the dll contains the control and presumably it's causing the problems.

    If you instead add your intended references ( all of them ).

    Then an xmlns.

    Then your control in xaml.

    IE add it without drag and drop.

    Does that then run ok?


    Hope that helps.

    Technet articles: WPF: MVVM Step 1; All my Technet Articles

    Tuesday, October 20, 2015 8:03 AM
  • Hi @Andy ONeill and Xavier Eoro,

    Regarding "if you use your control (4.5.1) in your project which’s framework target was .net 4.6, in my experience, it could work well. You could add dll (4.5) in your project and use it",  Yes. This scenario will work well. No issues with it.

    Regarding "I might not understand your question clearly. Why have you made entry in registry?", i made the entry in registry to add the proper framework version reference assembly after drag and drop a control from Visual Studio. Actually am facing issue after drag and drop a control in Visual Studio 2015 toolbox. My customer has reported that after configured our .NET 4.6 framework controls in Visual Studio 2015 toolbox , drag and drop a control in designer page, the reference assembly added in reference section of the project is not related to the target framework version.  This is what the issue is. How it can be resolved? Manual reference working fine.

    Regards,

    Vadivel 



    Vadivel Natarajan

    Thursday, October 22, 2015 11:50 AM
  •  My inclination would be to not add the reference from code at all.

    There again, I don't develop controls for other companies to use.


    Hope that helps.

    Technet articles: WPF: MVVM Step 1; All my Technet Articles

    Thursday, October 22, 2015 12:20 PM