0

I looked for the answers here and there with no luck, so I decided to ask out. I want to implement openalpr (open source Automatic License Plate Recognition) repository on my own PC and I am following this video to accomplish the task. I have done all the steps he did and at the end, when I tried to build it but, in one of the .cs code there is CS0246 error that says:

Error   CS0246  The type or namespace name 'AlprNet' could not be found (are you missing a using directive or an assembly reference?)   number_plate    c:\users\sohib\documents\visual studio 2015\Projects\number_plate\number_plate\Form1.cs

part of the code

I could only find AlprNet in my D:\Projects\plate_recognition\openalpr-master\src\bindings\csharp\AlprNetTest and it is in .csproj format.

AlprNet is not in .dll format like other references so I cannot reference it in References. I found some say that it might be because of different versions of .NET Framework platforms. I almost did nothing to check that, because I don't think it's related to .NET

In my mere opinion I should link that AlprNet.csproj to get its content, but I'm not sure. If someone can help get around this issue, I'd be very grateful.

bit_scientist
  • 1,496
  • 2
  • 15
  • 34

1 Answers1

0

If it's not a .net Assembly (dll) that's referenced and it's not a nuget package, then check that the code isn't expecting the Assembly to already be present in the Global Assembly Cache (If you have access to another developer machine where this works, this is easy to check).

Failing that, adding the .csproj to your .sln and then referencing it sounds like the way to go (provided you have access to that of course!).

gplumb
  • 712
  • 6
  • 29
  • how am I supposed to check that code isn't expecting the Assemply to be present in GAC? I am facing this for the first time. – bit_scientist Aug 22 '18 at 02:49
  • thank you! I used `gacutil /l AlprNet` to list its contents and it returned `Number of items = 0` since there was no specific parameter to check that code isn't expecting the Assemply to be present in GAC. Can I now consider that it failed? – bit_scientist Aug 23 '18 at 00:43
  • That just tells you that the assembly isn't in the GAC on your machine. If you're developing your code with other devs, then it's worth running the command on a machine where the code compiles to check. If you're the only dev, then the .csproj reference is the way to go (assuming you have access to the source code!) – gplumb Aug 23 '18 at 13:35
  • I was curious and decided to take a look at the alpr github. I was able to add the binding found in the path: ./openalpr/src/bindings/csharp/alprnet/AlprNet.csproj . (Please note, you will need to ensure that libopenalprc.dll and its' dependencies have been copied alongside the output of your build (bin\Debug or bin\Release), as mentioned here: https://github.com/openalpr/openalpr/blob/master/src/bindings/csharp/readme.md – gplumb Aug 29 '18 at 22:52