I am getting following error when i am trying to build my c# project:
The type or namespace name xyz could not be found (are you missing a using directive or an assembly reference?)
I have given reference of required file . don't know why this error is coming again and again?
Thanks in advance
You probably need the using directive too. In the file that is throwing the error, add:
using xyz;
Obviously substituting xyz with the correct namespace.
Related
I have seen so many QA about this error, but none of them solved my issue,
Here we go:
I have this namespace: Microsoft.MixedReality.Toolkit.SpatialAwareness.Processing
Which is included in a DLL called: Microsoft.MixedReality.Toolkit.PlaneFinding
Now, there is a second DLL called Microsoft.MixedReality.Toolkit.SDK
Which is referencing the first DLL, and also defines a constant called PLANE_FINDING_PRESENT the somehow relates to it (Here are some photos from the inspector and VS to show what i mean)
Inside of the DLL called Microsoft.MixedReality.Toolkit.SDK there is a file called SurfaceMeshesToPlanes
In this file i am attempting to be using the namespace Microsoft.MixedReality.Toolkit.SpatialAwareness.Processing like so:
I am expecting this whole thing to work but i am getting error:
Library\PackageCache\com.microsoft.mixedreality.toolkit.foundation#2eb95bb1aae9-1646916095499\SDK\Experimental\SpatialAwareness\SurfaceMeshesToPlanes.cs(13,55): error CS0234: The type or namespace name 'Processing' does not exist in the namespace 'Microsoft.MixedReality.Toolkit.SpatialAwareness' (are you missing an assembly reference?)
Any thoughts?
The problem was in the platforms section in the desired dll, once i changed it to any it became visible to the other dll
I am using asp.net core web application with Visual Studio 2015. I have added a reference project and implemented the method which is working fine.
Here is the screen shots
Now I have removed the dependency from project.json and deleted the project.lock.json file. I have completely removed the reference.
When I completely remove the reference I am still able to use UserViewModel and Go to definition opens the file in metadata. But I cannot use the JwtTokenViewModel.
The error details
error CS0246: The type or namespace name 'JwtTokenViewModel' could not be found (are you missing a using directive or an assembly reference?)
I did some research and found that we get cs0246 error is due to reference problem. I have followed the solution of some link but not a solution
Why am I getting error CS0246: The type or namespace name could not be found?
How can I resolve this issue. Please anyone let me know.
This is a follow-up question from "c# Wrapper for CNTK step"
After adding reference EvalWrapper.dll, The type or namespace name 'IEvaluateModelManagedF' could not be found error went away.
The next compile error I encounter is at line
model.CreateNetwork(string.Format("deviceId=-1\nmodelPath=\"{0}\"", modelFilePath));
Error CS1061 'IEvaluateModelManagedF' does not contain a definition for 'CreateNetwork' and no extension method 'CreateNetwork' accepting a first argument of type 'IEvaluateModelManagedF' could be found (are you missing a using directive or an assembly reference?)
I made sure all the DLLs are in the same directory as EvalWrapper.dll.
What am I missing ?
Thanks in advance,
I encountered this error too. To solve the problem you should add the following using clause at the beginning of your code:
using Microsoft.MSR.CNTK.Extensibility.Managed;
On Windows Phone 8.1, in an C# project, I want to get the device ID via -> DeviceExtendedProperties
So I might want to do it like
using Microsoft.Phone.Info;
DeviceExtendedProperties.GetValue("DeviceUniqueId");
or
Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceUniqueId");
The problem is, either way didn't compile,
I don't know what I'm missing.
It says it was supported in WP8.1
This is the error when I use the name space at the top of the file:
using Microsoft.Phone.Info;
error CS0234: The type or namespace name 'Phone' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
Same error when I call the function directly
Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceUniqueId");
I find the answer,
Add the namespace at object browser.
anyway, thank you guys for the answer.
I'm receiving the following error:
Error 26 The type or namespace name 'Controls' does not exist in the namespace 'Microsoft.Windows' (are you missing an assembly reference?)
These two assemblies appear in the .g.cs file:
using Microsoft.Windows.Controls;
using Microsoft.Windows.Controls.Primitives;
When I remove them, the error returns.
Check your XAML code. Probably there will be xmlns pointing Microsoft.Windows.Controls.Primitives or Microsoft.Windows.Controls.