Can't find namespace in Global - c#

I have the job of getting a legacy project working again. This project was done many years ago using Silverlight and C# Class Library's.
The error I am getting is to do with a namespace inside the project file called Silverlight.Business:
Code
using Tcx = global::MapTools.Xml;
Error:
The type or namespace name "MapTools" could not be found in the global namespace (are you missing an assembly reference?)
MapTools is a C# Class Library and Silverlight.Business is a Silverlight Library. Due to this I can't add a reference to MapTools inside the Silverlight project file.
The silverlight project does have a WCF RIA Service's Link but that does not connect to anything.
I am now wondering how the person that wrote the code has managed to call that namespace? I have tried researching how to add the MapTools.dll to the Global namespace but have not found anything.
Anyone have any ideas?

To do that there should be an some tool been used .
We had used in our projects a Portable library which allowed us to communicate through cross type of projects , below is the link :
https://msdn.microsoft.com/library/gg597391(v=vs.100).aspx

Related

C# Different but similar Namespaces cause errors

I currently have to deal with two different namespaces.
The first namespace is from a class library and looks like this: Autodesk.DataManagement.Client.[...]
The second one is a wrapper library I am coding and has the namespace: My.Autodesk.Wrapper[...]
My problem is that this is throwing tons of errors because the IDE can't make a difference between my namespace and the namespace of the library (I use both libraries in the same class)
This is the error I get Error CS0234 The type or namespace name 'Connectivity' does not exist in the namespace 'My.Autodesk' (are you missing an assembly reference?)
EDIT for additional information:
Currently my library only contains a Connection Class and a IConnection interface.
Without referencing my wrapper library the code in the main project works fine:
But after referencing my library everything in the main project breaks:
It looks like it is mistaking my library with the Autodesk library just because I have the term Autodesk in my namespace.
What would be the solution? Do I really have to rename my library?
try using this format
using YourClass = My.Autodesk.Wrapper.[..].YourClass

How do I reference another project in a Unity C# script

Hi I have some C# code in a .NET class library that I wrote a while back. If I want to reference that code in a Unity script (Unity 2018.4.19f1 if that matters), how do I go about that?
If I add a project reference to my Unity Assembly-CSharp project in Visual Studio, it doesn't seem to work. I get;
Script.cs(3,7): error CS0246: The type or namespace name
'other-project-namespace' could not be found (are you missing a using
directive or an assembly reference?)
Does the class .NET class library need to be target a particular framework/platform? Ideally I'd like to use the same library across platforms if possible.
you need to build it, then it gave you a DLL file
import that in unity and use it

silverlight Application can not use wcf namespace

I have a Silverlight application with a web application to test it,
there are two WCF services I created on my web application.
I can add reference all my services in my Silverlight application but when I want to use one of my data contracts ,I can not add my service namespace to the Silverlight application:
ex: I have a person class in my WCF service(reference name)
WCF service.person = new wcfservice.person();
Error:
The type or namespace name 'WCF service' could not be found (are you
missing a using directive or an assembly reference?)
I can add reference all my services in my Silverlight application but
when I want to use one of my data contracts...
You can't bring in the namespace because it exists in an assembly which has been complied in a different CLR. But that doesn't mean one can't work with the defined class. By bringing the target class(es) into the Silverlight project via the use of a linked file one can safely work around the CLR differences.
A linked file is built in both projects, the original and the linked, but only resides in one location; hence changes made to it are reflected in both projects.
In the Silverlight project add the target file(s) and then choose:
That way you can use the class within the namespace as such, for it is compiled into the Siliverlight programs scope; but any changes made to the file are also reflected in the Silverlight app.

Namespace is no recognised while used inline. But mentioned at the top with using keyword , it works

I am referring to an internal project. My current project uses reference of that project. My current project namespace is currentProjOne.currentProjTwo.currentProjThree. and the project which i am referring is namespace is referredOne.referredTwo.referredThree.
In my current project when i add referrend project on top of .cs page with using keywords like using referredOne.referredTwo.referredThree, All classess of that method are recognised by compiler.
But when i refer class as referredOne.referredTwo.referredThree.class it throws compile time error of missing assembly.
let me put some point .
i have referred correct dll to the project
i have only one dll for that project
both the project are class liabrary and .net framework pointing to .net4 (not .net4 client profile).
I am clueless why this is happening. Please help.

Namespace in Referenced Project Present in Autocomplete Before Building, but Causes Compile Error After Building

I have a class library project which uses a namespace (e.g., "Cosmos.Creator.Util"). I then create a solution and windows forms application to test the library. From the windows form application, I add a reference to the library. So now I have two projects open in visual studio, a class library and a windows forms project. The forms project references the library.
When I edit my form's code, code autocompletion works correctly for the namespace that I use in the library. E.g., if I type "using Cosmos." I get autocomplete options like "Creator". But now if I build my solution, all of the "Cosmos" are red-underlined with the compile error: "The type or namespace name "Cosmos" could not be found (are you missing a using directive or an assembly reference?)".
For the purposes of the form application test, I placed my library code into a folder CosmosFormExample\Cosmos. When I check the reference from the form application, the reference is to CosmosFormExample\Cosmos\bin\Debug\Cosmos.dll, so that looks okay. I looked at the GUID referenced in the solution file and it matches the GUID of the project file Cosmos.csproj.
What has happened? How has the build caused my forms application to forget about the Cosmos namespace, despite the fact that it is still referencing the library project? Thanks much in advance.
Are you using VS2010 & .NET 4? If so you're probably using .NET 4 Client Profile instead of full fledged .NET 4. Go to project properties and check your Target Framework.
for more info: http://msdn.microsoft.com/en-us/library/cc656912.aspx
you need to check the framework you are using and the framework yout library was compiled for...

Categories

Resources