You are here: Start » AVL.NET » Getting Started with Adaptive Vision Library .NET
Getting Started with Adaptive Vision Library .NET
Requirements
Adaptive Vision Library is designed to be a part of applications working under control of the Microsoft Windows operating system. Supported versions are: Vista, 7, 8/8.1 and 10 as well as corresponding embedded editions. To build an application using Adaptive Vision Library under Microsoft Windows, Microsoft Visual Studio environment is required. Supported versions are: 2010, 2012, 2013 and 2015.
SDK Installation
The installation process is required to copy the files to the proper folders, set necessary environment variables and facilitate license loading with License Manager tool, available in the Start Menu. It also helps creating Visual Studio applications referencing AvlNet.dll assembly.
Directories
Adaptive Vision Library .NET is distributed as a managed assemblies (*.dll), available in two versions: for 32-bit and 64-bit systems. Assemblies are located in following directories:
32-bit |
%AVL_PATH48%\bin\Win32\AvlNet.dll %AVL_PATH48%\bin\Win32\AvlNet.TS.dll %AVL_PATH48%\bin\Win32\AvlNet.Designers.dll |
---|---|
64-bit |
%AVL_PATH48%\bin\x64\AvlNet.dll %AVL_PATH48%\bin\x64\AvlNet.Ts.dll %AVL_PATH48%\bin\x64\AvlNet.Designers.dll |
where %AVL_PATH48% is an environment variable set during Adaptive Vision Library installation.
Creating New AVL.NET Project With Project Template
Once the Adaptive Vision Library is installed, a new Visual Studio project template - AVL.NET Application - appears in the Visual Studio New Project and Add New Item dialog boxes (Visual C# » AVL » AVL.NET Application). It is a recommended way of creating a new .NET project that will reference AvlNet.dll assembly since all required configurations are set automatically and the application is ready to be compiled targeting both x64 (64bit) and x86 (32bit) platforms.
Creating New AVL.NET Project Manually
It is most important thing when referencing AvlNet.dll assembly to choose appropriate library bitness. There are two versions of the AvlNet.dll assembly:
one for x64 platform and one for x86 platform. Taking that, application must know which assembly to take in all of its configurations.
Unfortunately Visual Studio in its IDE does not provide conditional referencing of the assemblies and it must be defined manually in
application configuration file (*.csproj), e.g. using Condition
attribute of the Reference
element:
<Reference Include="Avl.Net" Condition="'$(PlatformName)'=='x64'"> <HintPath>$(AVL_PATH48)\bin\x64\Avl.Net.dll</HintPath> </Reference> <Reference Include="Avl.Net.TS" Condition="'$(PlatformName)'=='x64'"> <HintPath>$(AVL_PATH48)\bin\x64\Avl.Net.TS.dll</HintPath> </Reference> <Reference Include="Avl.Net.Designers" Condition="'$(PlatformName)'=='x64'"> <HintPath>$(AVL_PATH48)\bin\x64\Avl.Net.Designers.dll</HintPath> </Reference> <Reference Include="Avl.Net" Condition="'$(PlatformName)'=='x86'"> <HintPath>$(AVL_PATH48)\bin\Win32\Avl.Net.dll</HintPath> </Reference> <Reference Include="Avl.Net.TS" Condition="'$(PlatformName)'=='x86'"> <HintPath>$(AVL_PATH48)\bin\Win32\Avl.Net.TS.dll</HintPath> </Reference> <Reference Include="Avl.Net.Designers" Condition="'$(PlatformName)'=='x86'"> <HintPath>$(AVL_PATH48)\bin\Win32\Avl.Net.Designers.dll</HintPath> </Reference>
To have the built application work properly, besides AvlNet.dll assembly there must be also native AVL.dll library present in the application directory. This can be achieved with PostBuildEvent which will copy appropriate version of the AVL.dll library:
<PostBuildEvent Condition="'$(PlatformName)'=='x86'"> xcopy /D /Y "$(AVL_PATH48)\bin\Win32\avl.dll" "$(TargetDir)" </PostBuildEvent> <PostBuildEvent Condition="'$(PlatformName)'=='x64'"> xcopy /D /Y "$(AVL_PATH48)\bin\x64\avl.dll" "$(TargetDir)" </PostBuildEvent>
Next: Relation between AVL.NET and AVL/C++ |