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
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.
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!).
Related
I am trying to ressurect an older project of mine in a newer Unity3D version. This is all well and good, except for a plugin that it was using is messing up.
I am using TouchScript : https://github.com/TouchScript
I updated to the newest version and everything, but i keep getting an error saying:
Assets/Scripts/Puzzle/Gesture Usage/PickupScript.cs(149,33): error CS0246: The type or namespace name `TouchHit' could not be found. Are you missing a using directive or an assembly reference?
This script has the required Using TouchScript.Hit; line. And i opened up the DLL to make sure that the class "TouchHit" is there, and it is. However when viewed in monodevelop by going to the DLL itself, it does not show at all. It shows the other classes that are supposed to be there, but not that specific TouchHit class.
I used that class, thus the error. But i am unsure on how to proceed with fixing this. I tried all sorts of import settings but no luck.
Any ideas?
Sincerely,
Smileynator
The classes in question were marked INTERNAL at some point, and documentation did not reflect this until i started looking at the commit regarding this change in feb 2014.
https://github.com/TouchScript/TouchScript/commit/ccb1a6cb44cb444618ca613fe1f8e5b15c076cc3
I'm using Visual Studio 2013, and I'm getting an error in my C# code that I can't figure out. I'm working with the Microsoft Kinect SDK, but I'll keep it general.
I downloaded the SDK, and I can get the included sample programs to build and run. But when I try to use the code in my own project, I get the
Type or namespace name 'Kinect' does not exist in the namespace 'Microsoft' (Are you missing an assembly reference)
error.
The thing is, I'm not missing an assembly or reference. I have it added to the project's references, and the path is valid. Also, the using statements at the top of the file will autocomplete to "Kinect" for me. If I start typing using Microsoft., Kinect will appear as an autocomplete option.
What are the steps to debugging an error such as this? Could it be a 32/64 bit issue? I tried using Dependency Walker to look at the Kinect DLL, and while it throws some errors (Error: Modules with different CPU types were found.), it doesn't show any issues that I don't see with other DLLs that I'm using successfully.
What are some other potential issues that might cause a problem with DLLs not being recognized?
1 - Try going to your project settings and verify the version of the .NET framework it uses.
The best to do is to choose the same version as the external libraries.
If it's a client profile, it will very often bring that exact problem. (I'm not sure what the client profile is, but I ended up never using it...)
2 - Check if any of your references got an exclamation mark.
I have a strange issue with my generated serialization .dll. The .dll is successfully generated I can reference it in my project, all the types are contained within the namespace Microsoft.Xml.Serialization.GeneratedAssembly as expected, even the intellisense is picking up the types and namespaces. But when I go to build the project referencing any of the types within the generated assembly I get an error along the lines of:
Error 2 The type or namespace name 'Xml' does not exist in the
namespace 'Microsoft' (are you missing an assembly reference?)
Rather odd, no? The namespace clearly exists as far as intellisense is concerned and I've never had an issue like this before. I tried to regenerate the assembly, still the same problem.
For now I have run sgen.exe with the flag /keep and just copied the generated source into my project which is fine. I was just curious if there was a way to fix this issue or if anyone else has ever come across it before.
EDIT:
It turns out that the issue is because the generated assembly is targeting a version of the .NET framework greater than the assembly that is referencing it. Now the question becomes - how do I generate a serialization assembly with Sgen that targets a specific .NET framework version.
Ok so after reading the answer on this question I managed to generate a serialization assembly that has the correct "runtime version" for .NET 3.5 and everything works as expected, sorry for wasting time.
I'm trying to build a solution composed of multiple projects in Visual Studio 2010, but one of the projects is giving me a strange error when I compile it:
Cannot load referenced assembly: C:\Windows\assembly\GAC\stdole\7.0.3300.0_b03f5f711d50a3a\stdole.dll
System.IO.FileLoadException - API restriction: The assembly 'file:\\\<same as above>' has already loaded from a different location. It cannot be loaded from a new location within the same appdomain.
At first I though I would need to remove this stdole.dll reference, so I deleted it. However, after deleting it, I get the following error instead:
The type or namespace 'stdole' could not be found (are you missing a
using directive or an assembly reference?)
Adding the reference back again gave the first error again.
I understand why I get the last error, but I don't understand why I'm getting the first. I'm fairly new at .NET, and am the only one remaining at my current company with any experience with C#, meaning that there's no one here who can help me. I've also spent some time trying to look up a solution online, but my lack of experience in this domain is making it hard for me to find an answer I can understand.
Any help with this would be greatly appreciated!
You can directly add reference to file by address for example:
C:\WINDOWS\assembly\GAC\stdole\7.0.3300.0__b03f5f7f11d50a3a\stdole.dll
Not from GAC (Registered Assemblies)
I would first like to admit that I am an extremely novice developer, so I'm doing my best to give all of the relevant information to make this question answerable:
So I'm trying to do some unit tests for NxBRE before I start attempting further work with the engine. I've downloaded both NxBRE and NUnit (version 3.2 and 2.6 respectively) and I've tested NUnit to make sure that it is working properly using a simple example that I could post here, but seems irrelevant to do so. What's important was that I was easily able to reference the nunit.framework.dll in the example, and the tested attributes compiled and the GUI ran the tests perfectly. I'm using SharpDevelop by the way.
I then opened up the provided NxBRE solution, which has two projects (NxBRE and NxBRE-UnitTest), added the same reference in the Unit-Test project to the nunit.framework.dll, and attempted to build the solution. I got a compiler error (along with the host of associated errors) stating that:
CS0246: The type or namespace name 'nunit' could not be found (are you missing a using directive or an assembly reference?)
Well, I was pretty sure I wasn't missing either, so I double checked the reference, and it seemed good (in that I re-added it in the way that I had for my test example). I even manually copied the .dll to the directories that were being accessed. I don't think it was an issue with NUnit itself, because I went back to my crafted example and it still ran fine.
Do you have any suggestions for trouble-shooting ideas or techniques that I should try?
I examined the .csproj file of the NxBRE 3 test project, and there is no directory path associated with nunit.framework.
In other words, the test project expects NUnit to be installed in the Global Assembly Cache. Could it be that you have not installed NUnit via its .msi file but rather unpacked it from a .zip file?
My recommendation is that you remove the nunit.framework reference from the test project and then add the reference again by browsing for the actual DLL file in the file system.