EbaySDK using reference missing even after install package - c#

I have installed a NuGet package called EbaySDK by ebay on my project. But problem is still cant use following using reference
using eBay.Service.Call;
using eBay.Service.Core.Sdk;
using eBay.Service.Util;
using eBay.Service.Core.Soap;
You can check and for better understanding. Any idea with EbaySDK usage? What mistake i am doing here? A sample usage of that SDK document also available here SDK Document

As requested by the OP:
It seems that the needed references never made it to the references location. If this happens, try installing the NuGet package via the console.
You may have to uninstall it first:
uninstall-package ebaysdk
And then:
install-package ebaysdk
Check the references of your project. Does ebay.Service show up? If so, you are ready to go. If not, you can try adding the reference manually. It should get downloaded to your project folder into the subfolder packages. For example:
\YourProject\packages\eBaySDK.3.805.0\lib\net40\eBay.Service.dll
You can add it via Add Reference... and then manually navigating to the folder.

Related

Interaction.InputBox does not exist even though I add reference to project and include Microsoft.VisualBasic

The following line gives an error saying it doesn't exist in the current content.
Interaction.InputBox("Enter Version", "", "default");
I read other questions about this I did every possible way;
Added reference to Microsoft.VisualBasic from project add section, also included;
using Microsoft.VisualBasic;
I don't understand why it creates problem.
Probably you've got an old version of the Microsoft.VisualBasic.dll.
Click on Dependencies > Frameworks > Microsoft.NETCore.App > Microsoft.VisualBasic.
Then look in the Properties window.
There you should see ..\net5.0\Microsoft.VisualBasic.dll.
If you see ..\netcoreapp3.1\Microsoft.VisualBasic.dll - that's too old.
To get the new Microsoft.VisualBasic.dll you have to base your App on .NET 5.0.
I have the same error as yours. I solved it by adding Microsoft.VisualBasic reference through Nuget package tool instead of by myself.
Propably the dll version in our system is too old, and Nuget can install the correct one.

Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Xamarin.Firebase.Messaging'

I want to use Push Notifications in my Xamarin application.
I used the following namespaces
using Microsoft.AppCenter;
using Microsoft.AppCenter.Push;
but I got the following error
Did not find reference matching RestoreAssemblyResources AssemblyName
metadata 'Xamarin.Firebase.Messaging' FirePush.Android.
If I add the nuget package Xamarin.Firebase.Messaging the problem persists.
First things first, make sure you have all the packages that are required from firebase are included, and the packages are added to the respective native projects.
make sure to have the latest updates versions of the packages,
then, refer this blog and do the simple steps mentioned over there,
http://evanp.net/xamarin-did-not-find-reference-matching-restoreassemblyresources-assemblyname-metadata/
once you are done with that clean the solution and rebuild.
The reason this is happening is that AppCenter push notifications are wrapped over FCM which means it is directly dependent on it.
Required packages:
Since you are using the app centre in your application you will need Microsoft.AppCenter.Push.(Windows) or App Center Push. (MAC) package from NuGet,
Other than that you will have to add Xamarin.Firebase.Messaging Nuget to add the dependent firebase API's
Once you are done with this you will have to clean build and maybe even clear bin obj for it to work.

How do I reference Route and ResponseType Attributes?

My computer unexpectedly crashed while I was working in visual studio on a web application. As a result my csproj was completely corrupted, so I had to start a new web project and re-add all the files and assemblies from my old project.
But for some reason Route, which should be in System.Web.Http, and ResponseType, which should be in System.Web.Http.Description cannot be found, even though I still have the appropriate usings for them. Also, my project is still referencing System.Web and System.Web.Http, and all the other stuff in my application seems to not be generating any errors like this at the moment.
I've also tried writing out the full path to these classes (i.e. System.Web.Http.Description.ResponseType) but while intellisense is able to explore the namespace, the Route and ResponseType attributes are missing.
I'm not sure if this is related, but when I right-click on Controllers and select Add, I don't get an option to add a controller any more. Something got really messed up with this project...
You should re-install the necessary packages to enable Attribute Routing.
From the Tools menu in Visual Studio, select Library Package Manager, then select Package Manager Console. Enter the following command in the Package Manager Console window:
Install-Package Microsoft.AspNet.WebApi.WebHost
Then after manually adding relevant references (i.e System.Web.dll and System.Web.Http.dll if they aren't already referenced) and using proper namespaces, your attributes should work:
using System;
using System.Web.Http;
using System.Web.Http.Description;
As an alternative to the accepted answer, I found that it was possible to automatically have the necessary packages installed as soon as the first Web API 2 controller is added to the project through the solution explorer's context menu.
Resolve for me by doing the following!
Save the solution
update-package -reinstall

The type or namespace IAppBuilder could not be found(missing using a directive pr an assembly reference)

I am working on an Asp.Net MVC 4 Application in which I am using SignalR 2.0.1 and I Mapped it using Owin Startup class and it worked fine at first.
All of a sudden when I tried to rebuild my app it said that the type are namespace IAppbuilder could not be found.
Following is my start up class
using Microsoft.Owin;
using Owin;
using WhiteBoardApp;
namespace WhiteBoardApp
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.MapSignalR();
}
}
}
I have installed Owin package too, and for some reasons I could not find Owin Startup class so I just added a normal class and included all the references that are needed.
May I know where I am making a mistake
Try to use Package Manage Console and do
Update-Package Owin -Reinstall
I was having similar issue. But instead Owin, problem was causing Microsoft.Owin, obviously
Update-Package Owin -Reinstall
Didn't work, neither did Update-Package Owin
BUT
Install-Package Microsoft.Owin
did work fine for me, thanks.
The IAppBuilder interface is found under Owin package. Just add a reference in your class file:
using Owin;
And rebuild. Your project will pick this up.
I have no idea why VS didn't pick this up, but it didn't. Once I added this reference to my project, then everything fell into place.
I encountered the same problem while building my project. Here are the steps that helped fix my problem:
Go to Solution Explorer and look for your project
Under your project, expand the References; You should see warnings on the problematic reference
Right click References and open Manage NuGet Packages
Search the name of problematic reference i.e. Microsoft.Owin; After loading it shows that it is already installed (It is, but it installed incorrectly. Checking the properties > version at step 2 shows 0.0.0.0)
Check Force uninstall, even if there are dependencies on it
Uninstall
Install
Build and run the project
Problems
Cannot install Microsoft.Web.Infrastructure because it already exists in the packages folder. Rolling back...
Go to your project folder and look for packages
Find the problematic package i.e. Microsoft.Web.Infrastructure
Delete the folder
Resume from step 7
Alternatives
Here are the alternatives I've read about to fix this kind of problem.
Clean and Rebuild Project / Solution
Restart Visual Studio
Restart PC
Good luck.
My Visual Studio 2013 for some reason didn't realize that the references paths existed. The yellow exclamation mark in front of the references was shown for all the added packages. I checked ../packages/ but all files existed, i also opened the .csproj file which referenced the correct paths.
Closing and opening the solution returned quite a lot of errors, and could not load the projects included in the solution.
Restarting Visual Studio 2013 saved the day for some unexplained reason.
My following using's equivalent in F# present a problem of hiding the IAppBuilder. It turns out that the Owin stipulation was being interpreted as an incomplete System.Web.Http.Owin reference, even though the Owin.dll providing the Owin namespace was referenced.
open System.Net.Http
open System.Web.Http
open Microsoft.Owin
open Owin
The problem was resolved by rearranging the usings as follows:
open Microsoft.Owin
open Owin
open System.Net.Http
open System.Web.Http
...granted, this may be a bug peculiar to the F# compiler and name conflicts are handle better in C# and elsewhere.
In my case, I had moved around the project folders and the location of the vs solution file (.sln). Once I was done with re-adding the projects, there was a packages folder on the solution level and one was left in a project sub folder.
This way, in that project, the relative package folder links in the .csproj file got messed up.
The reinstallation or other tips regarding the nuget package manager in this thread were helpful. I noticed, that after I reinstalled a few packages, in my git source code diff, the path of the packages folder was changed within the csproj file.
Before
<HintPath>packages\Microsoft.Owin.4.0.1\lib\net45\Microsoft.Owin.dll</HintPath>
After
<HintPath>..\packages\Microsoft.Owin.4.0.1\lib\net45\Microsoft.Owin.dll</HintPath>
So, if you run in the same issue and you have a lot of nuget packages, it might be easier to close the whole solution, open the csproj file(s) in a text editor like vscode and fix the relative links with search and replace. Then just save, close, reopen solution in VS and restore nuget packages. That should do the trick.
(In any case, you should delete the local packages folder on the project level, so that the project really fails, if it does not get the right packages.)
It's an ordering issue.
using Microsoft.Owin;
using Owin;
Leads to Microsoft.Owin to be defined first, then Owin is found under already imported Microsoft namespace. If you mouse over Owin of using Owin you should see it was resolved to Microsoft.Owin again and furthermore IDE will gray out using Owin as redundant unused reference.
Do:
using global::Owin;
Which clarifies for the compiler not to look for Owin under already defined namespaces (e.g. Microsoft. namespace).
http://www.asp.net/signalr/overview/getting-started/tutorial-getting-started-with-signalr
Check for the visual studio you are using
You can find the following comment
Note: If you are using Visual Studio 2012, the SignalR Hub Class (v2) template will not be available. You can add a plain Class called ChatHub instead.
Also
Note: If you are using Visual Studio 2012, the OWIN Startup Class template will not be available. You can add a plain Class called Startup instead.

Can't find PerRequestLifetimeManager class in Unity.MVC4 or Unity(3.0)

I am trying to locate PerRequestLifetimeManager. In MSDN, it says that it is part of the Unity 3 assembly.
I've installed Unity.Mvc4 via Nuget. The package.config says I am using Unity 3.0:
The Microsoft.Practices.Unity.dll says I am using Unity 3.0
I looked inside the DLL using object browser, and the PerRequestLifetimeManager is no where to be found.
Am I missing something here?
If someone will suggest an alternative class, I am planning to use a custom PerRequestLifetimeManager found here (if I am unable to find the class).
EDIT:
I've uninstalled Unity.Mvc4 and directly installed the Unity3.0 in the package console, here is what I got:
PM> Install-Package Unity -version 3.0.1304.1
'Unity 3.0.1304.1' already installed.
Successfully added 'Unity 3.0.1304.1' to RedLions.Presentation.Web.
I still can't find the PerRequestLifetimeManager class, even in the official library.
It seems not good to answer my own question when I just instead did it on my own. I can no longer delete my question.
Anyway, here was my solution.
I went straight to the source code of Unity, I found out that the class does exist in the same namespace but not in the same assembly. PerRequestLifetimeManager is in Microsoft.Practices.Unity.Mvc
I checked MSDN and it did say that its in a different DLL, which I failed to notice. Sorry about that.
It is not part of the Unity package in nuget, but in a different package in Nuget (Unity.Mvc), so here it is: http://www.nuget.org/packages/Unity.Mvc/
I decided to dump Unity.Mvc4 as it is no longer needed, everything is already in the Unity.Mvc. (App_Start/UnityConfig.cs)
you can delete the original DLLS and Uninstall the reinstall.
Run the following from PCM, Package Manager Console:
Install-Package Unity.Mvc
This will give you the DLL Microsoft.Practices.Unity.Mvc where it is.

Categories

Resources