DeviceExtendedProperties in C# - Microsoft.Phone.Info name space - c#

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.

Related

Missing / Not found Android.App namespace on Maui

I'm trying to migrate my Xamarin project to Maui and I got stuck on finding the equivalent namespace to Android.App.Application.Context on Maui project. The DatabaseHelper class has the following path: MyProject -> Platforms -> Android -> Helpers.
Does anyone know what is the equivalent namespace to Android.App.Application.Context on Maui?
CS0234: The type or namespace name 'App' does not exist in the namespace 'AAT.Platforms.Android' (are you missing an assembly reference?)
Picture of error
Thanks!
The error message is (indirectly) telling you what is wrong:
The type or namespace name 'App' does not exist in the namespace 'AAT.Platforms.Android'.
This is happening because you are in namespace AAT.Platforms.Android.Helpers, which means that Android is assumed to mean AAT.Platforms.Android.
Here are two ways to access Android.App.Application.Context in this situation:
global::Android.App.Application.Context OR
using AndroidApp = Android.App.Application;
AndroidApp.Context
Try changing your namespace to another thing that doesn't include Android. Because it's trying to find the class inside your namespace instead of the correct one. So I'd advise you to use Droid instead of Android in your namespace, i.e. AAT.Platforms.Droid.Helpers.
HIH

error CS0234: The type or namespace name does not exist in the namespace (are you missing an assembly reference?)

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

CS0246: The type or namespace name 'MySql' could not be found

how i can fix this problem??
help me
Compiler Error Message: CS0246: The type or namespace name 'MySql' could not be found (are you missing a using directive or an assembly reference?)
Line 1: using MySql.Data.MySqlClient;
Apologies if this is not the case but working on the assumption that you're developing in a version of Visual Studio, check the project references.
If MySql.Data exists in the references but has the warning (yellow triangle) indicator next to it then you may need to re-reference the .dll from its location in your filesystem.
Alternatively, you can grab this from the Nuget package manager if it is not available locally.
Despite the full namespace qualification, the library must be correctly referenced for the object namespace to be recognised in the IDE.
Let us know what IDE you're using if not VS.

Error 1 The type or namespace name 'FPSTimer' could not be found (are you missing a using directive or an assembly reference?)

I am following a code from Intel RealSense 3D camera. However I got this error. If I am supposed to add something to the Reference Assembly can you tell me what that is or how should this be fixed? This pertains to the FaceTracking example in the Intel RealSense 3D SDK Sample Browser.
private FPSTimer m_timer;
and here's the error:
Error 1 The type or namespace name 'FPSTimer' could not be found (are you missing a using directive or an assembly reference?) c:\users\mona\documents\visual studio 2013\Projects\wfa1\wfa1\FaceTracking.cs 10 17 wfa1
I'm thinking you may or may not have the correct references installed, and then you need to add the proper using statement in your code file?
I don;t have this particular SDK on my machine, but there is some documentation available HERE which may be helpful. In particular, maybe THIS section?

Showing error even if i have given required reference...?

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.

Categories