HttpClient & HttpResponseMessage missing in VS 2010 - its for consume REST services - wcf

does anyone know if HttpClient & HttpResponseMessage classes are available in VS 2010? I can't seem to get them to work, do i need to add a reference or using namespace?
These classes were originally from the starter kit for REST for Vs 2008... In vs 2010 its built in i.e. no use for the starter kit...
But how do I cosume them if these classes are missing...
I have searched google for an answer and all i keep finding is examples for vs 2008 i.e. the REST starter kit.
Any help really appreciated
Thanks in advance

Use NuGet to install the WebApi.All:
from VS2010 menubar: View -> Other Windows -> Package Manager Console
from Package Manager Console type in the command Install-Package WebApi.All
in .cs add "using System.Net.Http;"

No they are not. They will be in the next version of the .Net framework. Until then you will need to continue using the ones from the WCF REST Starter kit.

In adition to #RAM's answer, don't forget to include both
System.Net.Http.dll
System.Net.Http.WebRequest.dll
I had this problem with references and had them removed manually in order to clean some unused stuff. I'm mixing MVC with WebApi which sometimes gives me trouble. Anyway, that was it for me. I hope it helps someone.

Related

Unable to target netstandard or netstandardapp in VS2015

Having a hell of a time finding information on this - pretty straight forward question.
I'm trying to target the new netstandard and netstandardapp monikers in an RC2 project and visual studio is telling me the frameworks are unsupported. I see plenty of project.json files on GitHub using them...
Assuming I have to install something.
Please advise.
The current public tooling doesn't understand the netstandard* monikers. We're working on new tooling as we speak. Sorry for the inconvenience

Error "Unable to load one or more of the requested types" on Telerik ASP.NET MVC Project

I start with Piranha for a week now, after read the documents and questions here I still can't solve the problem, so I post it here. Please help me. (I'm using Visual studio 2013 Update 2, Piranha 2.2.4)
I tested Piranha on the template project. Everything is fine, now I create a Telerik ASP.NET MVC Q3 2014 project and follow the "Getting started" tutorial to add Piranha to an exist project. I got this error message (I also applied this issue https://github.com/PiranhaCMS/Piranha/issues/277)
http://pastebin.com/1B0WNA2V
When I remove Piranha and Piranha.MVC reference and add references from source project I get this error
http://pastebin.com/17CSziUK
Please help me. Thanks a lot
Piranha CMS uses MEF to import extensions into the framework. There's been issues before that some other projects don't play to nice with MEF, maybe the Telerik stuff you're using has this issue.
There's a fix coming in 2.3 where you can tell the framework to only scan the Piranha assemblies for extensions which would probably fix your issues. I'll see if I can deploy a patch for this!
Regards
HÃ¥kan

NHibernateIntegrationFacility configuration

I am trying to use NHibernateIntegration Facility by configuring using code, not XML. But couldn't find any reference code over the web. Can you please post any sample or provide reference.
Thanks,
Try to use the Fluent NHibernate API. I am developing using it a year ago and it is very good.
You can download the dll by NuGet in visual studio.
Link:
http://www.nuget.org/packages/FluentNhibernate

The type initializer for 'PayPal.Manager.ConfigManager' threw an exception >Paypal SetExpressCheckout

for some reason I am getting an error "cannot read config file" when trying to set the SetExpressCheckout, I have copied across the web config settings, but for some reason I cannot read them, the error isn't very helpful other than what I have mentioned.
I am using mvc4, and to be honest I have had a problem reading the web.config in the past..
any suggestions would be much appreciated.
Just looked at this... thought it might help someone. Looked at the Inner Exception, saw it was looking for the Log4Net dll... so I gave it to the app and hey ho. It worked.
I had a similar problem and ended up getting both the core and merchant sdk source from GitHub. Change the SpecificVersion=True to False for the log4net reference in the core sdk and re-build it. I also re-targeted both for .net 4.0 so I re-built the merchant sdk with a reference to the new core sdk. Import both of these new dll's to your main project and you should be good to go. I had to change the config in 1 place for the section handler.
<section name="paypal" type="PayPal.Manager.SDKConfigHandler, PayPalCoreSDK"/>
since the Assembly name does not have the underscores if built from source (vs downloaded or added via NuGet).
A bit of explanation:
I was already using log4net version 1.11 before adding the sdk. The sdk was looking specifically for version 1.10. these 2 versions have a different public key, so 'simple' binding redirection won't work. If you have a reference to a different version of log4net (for example using ninject logging extensions requires min version 2.11 so these 2 ninject and the paypal sdk, are incompatible off the shelf).
so the root of the problem was actually caused by the dll version issues but manifested as a Configuration exception. check the inner exceptions and see what you get.
ok, just a quick update, I think it must be something to do with MVC, I have created a new empty asp project, copied the sdk config details across, created the same function call as I have in my mvc code, and called it from a simple asp button... and it works ??
does anyone have any ideas why I am getting an error in an mvc4 project, and not in a simple asp project ??
any help or ideas would be much appreciated.

MVC4 - AuthConfig.cs missing

I am trying to get started with the OpenAuth features of MVC4 as described here:
http://pluralsight.com/training/Player?author=scott-allen&name=mvc4-building-m7-security&mode=live&clip=9&course=mvc4-building
I already did start over again a couple of times in order not to miss anything, but even though I am choosing the right template (Internet Application) there is no AuthConfig.cs.
Nor do I find documentation what to do to get the required tasks done manually.
I am pretty sure this is a pretty dumb question, but maybe I don't find the answer because it is so obvious...
thx
I followed these steps:
Open File/New/Project
Select ASP.NET MVC 4 web Application
Then Select internet Application
Once the project was created there should be a AuthConfig.cs file within App_Start folder
unbelievable.. I used the RC Version of Visual Studio and even though I reinstalled MVC4 from scratch the recent version including the openauth extensions wasn't properly available.
Following the same steps on the regular Visual Studio Installation did the trick...