I'm Developing a Windows CE device application in C#.
When I add reference System.Deployment to my project it should let me add Namespace: System.Drawing.Printing.
When I expand References I can see System.Deployment there, but when i want to add Namespace: System.Drawing.Printing i get error:
The type or namespace name 'Printing' does not exist in the namespace
'System.Drawing' (are you missing an assembly reference?)
What am I doing wrong?
I have done some research but can't find a solution.
You should add reference to System.Drawing assembly instead of System.Deployment
Read more about this namespace at msdn System.Drawing
Just add System.Drawing namespace to your solution.
Related
I am trying to import Steamworks from the Steamworks.NET package that I imported through the unity package manager.
I can clearly see that the Steamworks.NET package was installed and that it contains the namespace Steamworks.
However, when I actually try to use this namespace, like this:
using Steamworks;
I get the error:
Assets\Scripts\SteamIntegration\SteamManager.cs(15,7): error CS0246: The type or namespace name 'Steamworks' could not be found (are you missing a using directive or an assembly reference?)
This makes no sense to me - The namespace clearly exists in the project. Why can I not use it / How can I use it?
You seem to be using an Assembly definition for your scripts.
In that case you additionally will need to reference the assembly definition of according package(s).
In your case the file starting with com.rlabrecque....
I want to run the Xamarin project and did all the updates. When I run the project I get the following error
The type or namespace name 'Windows' could not be found (are you missing a using directive or an assembly reference?)
for the lines
using Windows.Storage;
using Windows.ApplicationModel.ExtendedExecution;
That's because you're missing these .dll
The recommended steps to get access to UWP APIs are listed in the dedicated blog post on Windows Blog.
Basically you can take two approaches: add the references to UWP dlls and winmd files manually or use the UwpDesktop NuGet package that will take care of this for you automatically.
For more details, you can check: How do I get access to Windows.Storage namespace?
I know this is a common error but I have the correct reference to the System.Data.DataSetExtensions.dll added to the project and my project is a SQL CLR project built for .net 4.5 and I'm getting the error at the following line:
using System.Data.DataSetExtensions;
I also checked the properties for the dll and it is referencing the correct version for the 4.5 dll so what else could possibly be causing this issue? Is this an issue with SQL CLR projects?
System.Data.DataSetExtensions is an assembly, not a namespace. You just need to add a reference to System.Data.DataSetExtensions.dll (as you say you already have) and then a using directive for the System.Data namespace:
using System.Data;
That will pull in all the extension methods in the classes in that namespace, e.g. DataRowExtensions.
When you're looking in documentation, always be careful about the difference between namespaces and assembly names - they're often the same, but they're logically independent.
The type or namespace name 'XmlConfigurator' could not be found (are you missing a using directive or an assembly reference?)
Am I missing a namespace???
You have to add log4net.dll to your project and the using log4net.Config; namespace
Your missing dll. Right click on your project and Add Reference... point to correct dll.
There is the possibility that you have not added the dll. This would require right clicking your project and adding the reference DLL. There is one other step that wasn't mentioned in the previous answers that I found relevant.
There is the possibility that you are not using the correct runtime. I found that log4net requires a full profile. For instance the client profile for .NET 4 will generate this error but if you use the full profile you will not experience this.
I have found this link:
Detect Antivirus on Windows using C#
However when I try this code in visual c# express edition 2008 it says :
Error 1 The type or namespace name 'ManagementObjectSearcher' could not be found
(are you missing a using directive or an assembly reference?)
C:\Users\Andy\Documents\Visual Studio 2008\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs 15 17 ConsoleApplication1
Amongst other similar errors on the 2 lines which seem important!
Looks like the code segment is missing some imports or something?
I am using Windows 7... Please help!
Andy
You are missing a reference to the assembly containing the type ManagementObjectSearcher, which is in the System.Managementnamespace. Add this namespace and it should work.
You will have to rightclick the project -> add reference and add the System.Management assembly. System.Managment is not added automatically with the creation of a new project.
WMI reference
WMI + C#