VS 2010 runtime version v4.0.30319

Thread is closed for posting
6 posts, 0 answers
  1. Greg Brondo
    Greg Brondo avatar
    13 posts
    Member since:
    Sep 2009

    Posted 13 May 2010 Link to this post

    Got a project I want to be targeted for the .Net 3.5 Framwork

    Define some classes compile it. Create another project in the same solution.
    in the second project I ref the first project. (or its dll, either way)
    The runtime version is specified as v2.0.50727.
    Then I enable some fields and classes for open access persistance.
    Then I enable to project for use ORM. Recompile.
    Now my runtime version is specified as 4.0.30319.
    I check all the refs in my first project and they are all listed with a runtime version of 
    v2.0.50727.

    So I think a dll one of these refs is dependant on is a 4.0 dll.

    I use dependancy walker to check a few of them and MSCOREE.DLL is a dependant. which is listed as version 
    4.0.311106

    So why is project 1 targeting a 4.x runtime after ORM enabling it? How can I stop this. I need the project to stay at 3.5
  2. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 14 May 2010 Link to this post

    Hello Greg Brondo,

    This is a known issue. Our enhancer is always generating .NET 4.0 assemblies if it is started in the default way. We are currently working on a fix for that.
    The workaround is to use the post build event to start the enhancer:
    "c:\programs files\telerik\openaccess orm\sdk\venhance.exe" "-assembly:$(TargetPath)"
    Please replace the path and set the event to 'when the build updates the project output'.

    You can also use the OpenAccess targets file. Additional information can be found here.

    Best wishes,
    Petar
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Greg Brondo
    Greg Brondo avatar
    13 posts
    Member since:
    Sep 2009

    Posted 14 May 2010 Link to this post

    This first workaround doesn't work. I have added the command line argument to the post build event and it is getting called corectly. I have followed the instructions correctly. But, the dll still gets compiled to .net 4 assemblies. As for the second workaround I do not completely understand all the things it is suggesting I try yet. I could eventually work through it, but I would much rather use the first much simpler workaround. Any ideas why it didn't work?
  4. Greg Brondo
    Greg Brondo avatar
    13 posts
    Member since:
    Sep 2009

    Posted 14 May 2010 Link to this post

    If the point of the second workaround is to get this line into your csproj file "<Import Project="$(MSBuildExtensionsPath)\OpenAccess.targets" /> " so that the OpenAccess.targets file gets imported which contains the line
    "<UsingTask TaskName="OpenAccessEnhancer"    
        Condition=" '$(UseOpenAccessTargets)' == 'true' " AssemblyFile="$(VEnhanceAssembly)"/>"

    I have done that and recompiled, this also didn't fix the issue.
  5. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 14 May 2010 Link to this post

    Hi Greg Brondo,

    Should you decide to use the post build command you will have to switch off the enhancing of your project from its properties in order to prevent the enhancer being run twice. This should fix your problem.

    Sincerely yours,
    Petar
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Greg Brondo
    Greg Brondo avatar
    13 posts
    Member since:
    Sep 2009

    Posted 14 May 2010 Link to this post

    Minor details... This worked though :^)
Back to Top