I can't use ActiveUp.MailSystem.Net - c#

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

Related

unable to find the namespace of a third party api

I have received a .dll file from a partner firm with an API that will be used for database logging. I have added it to the references and can see it in the Solution Explorer. The documentation provided gave me a code snippet which references the file with a different namespace than the file name. I am using Visual Studio 2013 Express.
using com.XXXXX.XXX.microsites.api;
When I want to use the EntityFramework, it is simply the name of the reference.
using Microsoft.AspNet.Identity.EntityFramework;
The reference is not even showing up with a different name when using IntelliSense.
I am using the recommend framework ASP.NET 4 in the documentation.
I am using the code snippet they provided.
I would personally use dotPeek (https://www.jetbrains.com/decompiler/) to decompile the assembly and see what the defined namespaces are. Not sure if there's anything build in to Visual Studio.
If you added the dll reference in your solution then try opening the dll in object browser and see if you see the namespaces listed there and then use the one needed.

How to implement IVsStatusbar when making a Visual Studio Add-In

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).

Could not find 'WindowsFormsApplication1.Program' specified for Main method after renaming name space

I have a C# app that had the default namespace WindowsFormsApplication1.
I decided that I would like to use a different namespace so I renamed WindowsFormsApplication1. Now when I compile I get the error:
Could not find 'WindowsFormsApplication1.Program' specified for Main
method.
To rename the namespace I highlighted the namespace in a file and hit F2.
How do I resolve this and change the actual namespace through out the project?
I am using Visual C# 2010 Express.
In project -> properties change "startup object" to the new namespace.
You should rename through the "Refаctor" feature of Visual Studio.
As Mausimo says you need to select the 'Startup object' in Project -> References, however I was finding that the new namespace was not being shown here; I could only select the old namespace or '(Not set)'. If you find the same then it appears VS (this is on 2013) does not pick up the change immediately, restart VS and you can then select the class under the new namespace.

Using Thrift and Apache.Cassandra in Visual Studio

I'd like to connect to Cassandra (already running on localhost) from C# (with Visual Studio IDE) using the "Thrift" and the "Apache.Cassandra" resources.
The first question is... shall I use a client like "cassandra-sharp" or the resources previously mentioned? I found an example (http://www.ridgway.co.za/archive/2009/11/06/net-developers-guide-to-getting-started-with-cassandra.aspx) using those resources and it seems easy to me.
And the second (stupid) question is: how can I external resources in Visual Studio? I installed NuGet and I downloaded Thrift (still looking for "Apache.Cassandra"), now it's placed in the "References" directory and I wrote "using Thrift.Protocol", etc in declarations...
but when I try to debug I get some errors like:
"The type or namespace name 'TTransport' could not be found (are you missing a using directive or an assembly reference?)"
Thank you all for the help,
Lorenzo
Get one of available clients for C# first, then learn if you need to build your own.
If you decide you'd like to build your own client (including connection pooling), you need to download from http://thrift.apache.org/download/ Thrift C# library sources (currently v.0.8) to include into your project, an msbuild task or Thrift.exe compiler to build C# Cassandra proxy sources/library from cassandra.thrift.

System.Windows.Forms.DataVisualization Namespace Fine in One Class but Not in Another

I'm getting this error
The type or namespace name 'DataVisualization' does not exist in the namespace 'System.Windows.Forms' (are you missing an assembly reference?)
Here is my using section of the class:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Windows.Forms.DataVisualization.Charting;
using System.Windows.Forms.DataVisualization.Charting.Borders3D;
using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
using System.Windows.Forms.DataVisualization.Charting.Data;
using System.Windows.Forms.DataVisualization.Charting.Formulas;
using System.Windows.Forms.DataVisualization.Charting.Utilities;
namespace myNamespace {
public class myClass {
// Usual class stuff
}
}
The thing is that I am using the same DataVisualization includes in another class. The only thing that I can think that is different is that the classes that are giving this missing namespace error are Solution Items rather than specific to a project. The projects reference them by link. Anyone have thoughts on what the problem is? I've installed the chart component, .Net 3.5 SP1, and the Chart Add-in for Visual Studio 2008.
UPDATE: I moved the items from Solution Items to be regular members of my project and I'm still seeing the same behavior.
UPDATE 2: Removing the items from the Solution Items and placing them under my project worked. Another project was still referencing the files which is why I didn't think it worked previously. I'm still curious, though, why I couldn't use the namespace when the classes were Solution Items but moving them underneath a project (with no modifications, mind you) instantly made them recognizable. :\
You are very likely missing a reference to the DataVisualization DLL. Note that although they share the namespace of System.Windows.Forms.dll, they aren't actually contained within it.
Solution items aren't used by compiled assemblies.
http://msdn.microsoft.com/en-us/library/1ee8zw5t.aspx
"They can be referenced by projects, but are never included in solution or project builds"
As far as I know, solution folders/items are really just meant for organizing things.
Are you getting actual build errors or just squiggles? Try building and look at the output window, does it succeed or fail?
In VS 2008 SP1 C# introduced a top level error squiggling feature. It's possible that if you open the solution item version of the file it will squiggle because of a lack of default references. The solution should still build correctly though.
If this is not the case try adding the file directly to the project (no link). See if that eliminates the error. If so then we know it has to due with a linked file and it can help track down the problem.

Categories

Resources