C# cannot find a used and referenced class - c#

I and a few friends are building a program made from 4 projects we are putting together.
While developing, we decided to move a class from one project to another. We changed the namespace and made sure all of the projects reference to the one containing it.
When running the project, the compiler gives a couple of error:
The type or namespace name 'dataList' could not be found (are you missing a using directive or an assembly reference?)
Cannot implicitly convert type 'DAL.dataList`1<classes.IBase>' to 'classes.dataList<classes.IBase>'
dataList is the class we moved from DAL to classes.
The class appears colored, and when I attempt to show the location by doing classes.dataList, it recognizes the class, but the compiler still gives the error.
A problem that appeared to one of us was an internal conflict that the compiler was reading from a deleted old file instead of the correct one (so it failed to load it properly), but it was fixed, and now this popped up.

It was resolved- I'm not entirely sure why or how. As far as I gathered, one of us played with the DAL, added and removed the references and it solved the issue.

Related

DLL import gone wrong? Missing class

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

VisualStudio.Net reference not working

I create a new solution called "WordpressAutomation"
I create a new project, a class library, called "WordpressAutomation" in this solution
I create a new project, a unit test project, called WordpressTests in this solution
I add a reference to the project WordpressAutomation in the project WordpressTests"
This should be ok, shouldn't it?
However, as can be seen from the screenshot, when adding this using line in a class in the project WordpressTests,
the reference doesn't work. Even though it is there, as can plainly be seen.
When entering "using", the class library "WordpressAutomation" doesn't appear among the alternatives.
And I get this error message when trying to run:
"The type or namespace "WordpressAutomation" could not be found (are you missing a using directive or an assembly reference?)"
Why is this happening? The reference is clearly there?
http://i.stack.imgur.com/L0g5R.png
Your project isn't actually including the .cs files to compile; they are only shown for information (they should appear as solid files with the C# logo):
Right click on these files and include them in the project. Then check what namespace they declare inside them. At the moment, your WordpressAutomation project simply doesn't contain any types.

stdole.dll has already loaded from a different location?

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)

Library reference imports ok, intellisense sees everything, objects instatiated... then I build and it can't find anything?

I run into this every once in a while and I never really figured out how to fix it. I have a class library that is in the same solution as the test console project. when I add a reference to the library in the console project and add the using statement, intellisense sees all of the classes just fine. So I write some code and use those classes. All of the class members are showing just fine. Then I hit build. I get an error that the classes from the library cannot be found (are you missing a using directive or an assembly reference?). Now all of a sudden, all my objects are underlined in red and no longer color coded as classes, and the using statement is also underlined in red. The reference to the library is still in the references folder. Wtf
If I remove the reference and readd it, its the same thing. It'll see everything just fine until i build.
Check that warning in your screen, saying "Referenced assembly UTILibrary could not be resolved because it has dependency on System.Web....". UTILibrary is probably using System.Web internally, so this dependency must also be added to TestConsole project.
Add it and all should be fine.

C# ASP.Net The type or namespace name 'Secure' does not exist in the namespace 'source_extranet'

Afternoon all,
I really need your help as this is a Nightmare!
I was earlier having a problem with referencing a 3rd Party Dll (Here) but have overcome this problem and am now having a problem referencing my own classes!
Everything seems fine at build with no errors at all but when I go to run the application it comes up with the following Compilation Error:
Compiler Error Message: CS0234: The type or namespace name 'Secure' does not exist in the namespace 'source_extranet' (are you missing an assembly reference?)
The line that the Error points to this line in the class:
source_extranet.Secure.BackendCustomData newdata =
new source_extranet.Secure.BackendCustomData();
This line of code points to a class in the same folder as the calling code class.
I have scoured Google looking for an answer and haven't found anything that points me to an answer to my problem.
Any help would be AMAZING!
Check that your class Secure also uses the source_extranet namespace. And if its a partial class make sure the partials also have the right namespace.
This has all been going wrong because a colleague was attempting to add in additional functionality and was clearly very unsuccessful!
Upon reverting his changes it is now working perfectly.

Categories

Resources