OpenAccess without installing it

4 posts, 0 answers
  1. Marko Gluhak
    Marko Gluhak avatar
    68 posts
    Member since:
    Apr 2006

    Posted 11 Apr 2012 Link to this post

    Hi,

    yeasterday I install new version of OpenAccess (2012.1.329.1). I had previous version before and it was woking fine. After I did all preparations (copy file to OpenAccessAssemblies directory, edit csproj file, replace references, ...) I cannot build my project any more.
    Error I'm getting is:
    OpenAccess.targets file points to a wrong enhancer location (c:\Program Files\Telerik\OpenAccess ORM\sdk\enhancer.exe). Please correct the setting located top in 'C:\Program Files (x86)\MSBuild\OpenAccess.targets' and restart Visual Studio.

    I double check everything and I have done like its stated here.

    In my OpenAccessAssemblies, OpenAccess.targets existas and its changed acoording to mentioned article.
    <PropertyGroup>
    <UseOpenAccessTargets Condition="'$(UseOpenAccessTargets)'==''">true</UseOpenAccessTargets>
    <OpenAccessPath Condition="'$(OpenAccessPath)'==''">OpenAccessAssemblies</OpenAccessPath>
    <EnhancerAssembly>enhancer.exe</EnhancerAssembly>
    </PropertyGroup>

    If I dont use this approach to have different version in project, everything is working fine.

  2. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 11 Apr 2012 Link to this post

    Hi Marko,

    We have added a check in the OpenAccess.targets file that makes sure we can find the enhancer.exe. The check is in line 341 and if it does not work you can just remove the line.

    Another cause can be that the import statement in the csproj file has been changed back to
    <Import Condition="Exists('$(MSBuildExtensionsPath)\OpenAccess.targets')" Project="$(MSBuildExtensionsPath)\OpenAccess.targets" />

    A third cause can be that you did not reload your solution after you have changed the path. VS cashes all these targets files and might have a problem there.

    All the best,
    Jan Blessenohl
    the Telerik team
    Telerik OpenAccess ORM Q1 2012 release is here! Check out what's new or download a free trial >>
  3. DevCraft banner
  4. Marko Gluhak
    Marko Gluhak avatar
    68 posts
    Member since:
    Apr 2006

    Posted 12 Apr 2012 Link to this post

    Hi,

    I have change back line in .csproj file to:
    Another cause can be that the import statement in the csproj file has been changed back to
    <Import Condition="Exists('$(MSBuildExtensionsPath)\OpenAccess.targets')" Project="$(MSBuildExtensionsPath)\OpenAccess.targets" />

    and it is working now but I think it is taking file from install directory and not from project. What I did to chek it was:
    1. Change line in OpenAccess.targets file inside "OpenAccessAssemblies" dir in project
    from: <EnhancerAssembly Condition="'$(EnhancerAssembly)'==''">enhancer.exe</EnhancerAssembly>
    to: <EnhancerAssembly Condition="'$(EnhancerAssembly)'==''">enhanc3er.exe</EnhancerAssembly>
    2. Close solution
    3. Restart VS
    4. Open project
    5. Edit .rlinq
    6. Save
    7. Rebuild.

    Everythign was OK (I did not get error that there is no enhanc3er.exe).

    I just want to make sure that when I install new version I will still be able to compile my old projects with old version (from OpenAccessAssemblies directory inside project).

  5. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 12 Apr 2012 Link to this post

    Hi Marko,

    I have found and fixed the problem. Thanks for reporting it, I have updated your telerik points.

    The problem is that in msbuild the Exists method does not accept relative paths. I have changed the check so that it should work now. For you to get it working, you can remove the error condition at the end of the file or replace it with:
    <Error Text="OpenAccess.targets file points to a wrong enhancer location ($(EnhancerAssembly)). Please correct the setting located top in '$(MSBuildThisFileDirectory)\OpenAccess.targets' and restart Visual Studio."
           Condition="!Exists('$(EnhancerAssembly)') AND !Exists('$(MSBuildThisFileDirectory)\$(EnhancerAssembly)') AND '$(MSBuildThisFileDirectory)' != ''" />

    The idea of this error was to make it easier to find the place where a wrong path to the executable is located.

    Your changes:

    Because you have changed the proj file, the targets file is now taken from installation path. You should switch back to the one that is part of your project and just change the error condition in that file.

    Regards,
    Jan Blessenohl
    the Telerik team
    Telerik OpenAccess ORM Q1 2012 release is here! Check out what's new or download a free trial >>
Back to Top