BING API, missing directive or an assembly - c#

I have download the new Bing API C# file and added it to my ASP.NET web site, it works perfectly if uses ASP.NET MVC 2.0 but with simple ASP.NET website it shows an error on this line:
var bingContainer = new Bing.BingSearchContainer(new Uri("https://api.datamarket.azure.com/Bing/Search/"));
The error is:
Error 1
The type or namespace name 'Bing' could not be found (are you
missing a using directive or an assembly
reference?)
c:\Users\jawad\documents\visual studio 2010\WebSites\BingAPI\Default.aspx.cs
Any idea what I am missing?

1) Verify you have the correct using statement for the API.
2) Verify the API is referenced properly.
3) Verify that your project and the bing api project (or .dll) both have the same .net version selected.

Related

Internationalization in asp.net 5

What is the correct way to use internationalization in a Asp.net 5 MVC project ?
If I try to decorate my model classes with DisplayName for example, Visual Studio gives me an error:
Severity Code Description Project File Line
Error CS0246 The type or namespace name 'DisplayName' could not be found (are you missing a using directive or an assembly reference?) MyProject.DNX Core 5.0 C:\Users\paulo\Documents\Visual Studio 2015\Projects\MyProject\src\MyProject\Models\Post.cs 20
I canĀ“t even create a resource file in this type of project.
You need to reference and import the namespace that defines this attribute:
`using System.ComponentModel;`

Web API not being recognized on my machine

I've pulled down a project onto my my machine that is using Web API. When I look at the nugget window it shows that I have web api 2.2, the web host, the core libraries, the client libraries, the cross origin support, and Data v 1-3.
However, when I try to build the project, I'm given the following errors:
The type or namespace name 'Cors' does not exist in the namespace 'System.Web.Http' (are you missing an assembly reference?)
and
The type or namespace name 'HttpApplication' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
Any help you guys and gals can give will be appreciated.
I've had the same issue after I had Resharper add the CORS reference.
I fixed it by adding the correct nuget packages: Microsoft.AspNet.Cors and Microsoft.AspNet.WebApi.Cors.

SQL Server Reporting Service 2010 | Not working in Console app

I want to list all the subscriptions made in the reporting server. For this I created a sample console application and added the reference of Microsoft.ReportViewer.WebForms.dll located in the
%Program Files(x86)%\Microsoft Visual Studio
11.0\ReportViewer\Microsoft.ReportViewer.WebForms.dll
But, when I am trying to create object of ReportingService2010 using the following
ReportingService2010.ReportingService2010 r = new
ReportingService2010.ReportingService2010();
It won't allow me to create the object, and throws a compile time error
error CS0246: The type or namespace name 'ReportingService2010'
could not be found (are you missing a using directive or an assembly
reference?)
Which ddl's I am missing here please help me.
Microsoft has a ReportViewer package that needs to be deployed (link below). Adding reference to the project from your development box may not be sufficient.
http://msdn.microsoft.com/en-us/library/ms251723.aspx
I believe the ReportingService2010 is not part of the reference Microsoft.ReportViewer.WebForms.
You need to add a web refrence to your project.
Here is a great tutorial from Microsoft, it shows you how to add a web reference to the SQL Server Reporting Web Service:
http://technet.microsoft.com/en-us/library/ms169926.aspx
If you follow these steps you should be able to use ReportingService2010 like this:
ReportingService2010 rs = new ReportingService2010();

Credentials for Webservices

I wanted to write credential for web services (I am using-VS 2008,Asp.Net Framework 3.5,Windows 2003 Standard Edition,SQL Server) like this
private Credentials credentials;
But i am getting error to this line that the type or namespace name 'Credentials' could not be found (are you missing a using directive or an assembly reference?)
I have used
using ExtentrixWS;
Still i am getting 'are you missing a using directive or an assembly reference?'
Regards,
You should not only add the "using ExtentrixWS" but also you should add the relavent dll to the references of the project. Then only the services of ExtentrixWS will be referrenced to your project.

Unable to access List using web reference in Sharepoint

I want to develop an application in C# which can access sharepoint data without any dependency to Windows Server Machine (Without using sharepoint dll). After adding reference to project I am unable to use this reference.
For example Web Reference name is: "MyServer". I am unable to use:
MyServer.Lists listService = new MyServer.Lists();
Showing error :
The type or namespace name 'MyServer' could not be found (are you missing a using directive or an assembly reference?)
How can i resolve this problem?
I think, the problem is that you have added a "service reference", not a SOAP web service web reference (see this article: http://alexduggleby.com/2008/08/24/add-web-reference-instead-of-service-reference-in-visual-studio-2008/)

Categories