This is a migrated thread and some comments may be shown as answers.
OpenAccess without installing it
3 Answers 156 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Marko Gluhak
Top achievements
Rank 1
Marko Gluhak asked on 11 Apr 2012, 11:43 AM
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.

3 Answers, 1 is accepted

Sort by
0
Jan Blessenohl
Telerik team
answered on 11 Apr 2012, 05:21 PM
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 >>
0
Marko Gluhak
Top achievements
Rank 1
answered on 12 Apr 2012, 09:51 AM
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).

0
Jan Blessenohl
Telerik team
answered on 12 Apr 2012, 01:51 PM
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 >>
Tags
General Discussions
Asked by
Marko Gluhak
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
Marko Gluhak
Top achievements
Rank 1
Share this question
or