I am following this guide AzureAdal to connect to the AzureAD. In the guide the class "AdalDistributedTokenCache" is used. But Visual Studio can't find the namespace and I get zero search results for NuGet packages or any other type of searches.
Does anybody know how to reach this class?
You could find it in this link.
using Microsoft.IdentityModel.Clients.ActiveDirectory;
I'm trying to use ActiveUp.MailSystem.Net which I downloaded from here:
https://mailsystem.codeplex.com/
I added all the dll-s through the add reference option. Now Using ActiveUp, Using ActiveUp.Net are working, but for the Using ActiveUp.Net.Mail I get the error The type or namespace name 'Mail' does not esist in..... I also added the dll-s to the resources but no luck. What makes me that noob?
P.S.: I'm using Visual Studio Express C# 2010
I am trying to create a visual studio add-in, and one of the things I will need to do is interact with the status bar. According to MSN: Status Bar it should be a fairly straightforward process. However, I cannot get it to resolve properly on the IVsStatusbar object.
The example suggests following a pretty standard process such as:
IVsStatusbar StatusBar = (IVsStatusbar)GetService(typeof(SVsStatusbar));
But Visual Studio will not resolve the reference and tells me IVsStatusbar does not exist. If I right-click to auto-resolve, it will just tell me to generate a new class for it.
I know it requires Microsoft.VisualStudio.Shell.Interop which I added, but still no luck. I have tried v 10.0 and v 11.0 of the dll, but neither have worked. Does it no longer exist in the namespace? Or is there another reference / object I should be using?
I should have all of the references I need:
using System;
using Extensibility;
using EnvDTE;
using EnvDTE80;
using Microsoft.VisualStudio.CommandBars;
using Microsoft.VisualStudio.Shell.Interop;
using System.Resources;
using System.Reflection;
using System.Globalization;
using Microsoft.VisualStudio.Shell;
You need to reference all of the versions of Microsoft.VisualStudio.Shell.Interop.xx.dll, not just one of them. Rather than change interfaces over time, they create a new assembly with added interfaces which the services implement in addition to the previous versions.
Edit: Note that this only applies to the Interop assemblies. For other assemblies, such as Microsoft.VisualStudio.Shell, you only need to reference version 10.0 (for a Visual Studio 2010 or 2010+2012 extension) or version 11.0 (for a Visual Studio 2012-only extension).
I am struggling with the following error when compiling my C# code with CSC - "error CS0234: The type or namespace name 'Core' does not exits in the namespace 'Microsoft.Office' (are you missing an assembly)"
I've had zero experience with object oriented programming before tackling this project. It involves automation of a couple devices through serial commands. Parameters are read from a native Excel file and data is written to Excel files that the code creates.
Here's what think maybe pertinent:
my compiling command: CSC /r:"C:\Data\Code\Microsoft.Office.Interop.Excel.dll" compiled.cs
I have the file Microsoft.Office.Interop.Excel.dll in the directory above. I found the file on my computer from something else that installed it. It is dated 2007.
I am using Office 2010
I installed Microsoft Office 2010: Primary Interop Assemblies Redistributable but can't tell what that did
I am referencing CSC from Framework (not Framework64) revision 4.0.30319
Here is the header to my code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO.Ports;
using System.Threading;
using Microsoft.Office.Core;
using Excel = Microsoft.Office.Interop.Excel;
using Microsoft.Office.Interop.Excel;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
Follow-up question (if I get this working) what things do I need to worry about to make this run on another computer? My thoughts was that all I needed was the .excel.dll and the .exe file in the same directory structure? (At this time I don't know what version of .NET or Office is being run on the target computer - my guess would be at least it would be Office 2010.)
Any guidance would be greatly appreciated. I've been wearing out google on this one for the past week+
Regards,
Keith
I know this is not the exact answer you're looking for, but I'm posting it because I think it would be more helpful than directly answering your question.
You would save yourself a LOT of time by downloading Visual C# 2010 Express and letting the IDE do the heavy lifting for you.
It sounds like you need to add a reference, which means referencing an existing .dll file somewhere. I know if can be done via the command line, but it's a LOT easier to use the IDE.
It's free, and can be found here: http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-csharp-express
There's a How-To guide for Office Interop here: http://msdn.microsoft.com/en-us/library/dd264733.aspx
I'm trying to write some WMI in my windows form and the ManagementObject is givin me the
"The type or namespace name 'ManagementObject' could not be found" Error
Here is my un-complete code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading;
using System.Security.Policy;
using System.Management;
using System.Management.Instrumentation;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
ManagementObject disk = new ManagementObject("Win32_LogicalDisk.DeviceID=\"C:\"");
Right-click References on the right and manually add System.Management. Even though I included it in the using statement I still had to do this. Once I did, all worked fine.
Have you added a reference to the System.Management assembly?
In Solution Explorer, right click on References, then Add Reference ... and under Framework, you should activate the System.Management framework.
You need to add a reference to System.Management.dll to your project.
You can see System.Management.Instrumentation without adding a reference to System.Management.dll because it is included in a different library (System.Core.dll, which is included as a reference automatically), but you cannot access the other types contained by that namespace without explicitly adding a reference to the System.Management.dll library.
~ just add System.management using nuget manager,
It worked for me! c#
I think the problem is there is no WMI object for Win32_LogicalDisk.DeviceID=\"C:\".
Try to replace:
ManagementObject disk = new ManagementObject("Win32_LogicalDisk.DeviceID=\"C:\"");
with:
ManagementObject disk = new ManagementObject("Win32_LogicalDisk");
and then to step through each field:
foreach (ManagementObject o in disk.Get()){
//Do what ever you need here.... For example:
Console.WriteLine(o.ToString());
}
Make sure your project isn't set up to compile against the .NET 4 Framework Client Profile.
Please see Namespace not recognized (even though it is there) for more details.
The version of Visual Studio that I have does not import ManagementObjectSearcher by importing "System.Management" namespace. If you have the same issue, try adding a reference to "System.Management.dll' by doing the following steps.
Click on project properties on solution explorer in Visual Studio.
Go to "References".
Click on "Add" to add a new reference.
Click on "Browse...".
Navigate to "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727".
Add a reference to "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Management.dll".
This is quite an old post but I just had to troubleshoot this. The only way I got it working with Visual Basic 2022 was to download and install through the NuGet Installer. Manually adding the .dll did not work for me. Once NuGet Manager is open Search: System.Management and download the latest from Microsoft, hope this helps someone.