SparkleNetworks / LinkedInNET

Sparkle.LinkedInNET will help you query the LinkedIn API with C# :)
https://www.nuget.org/packages/Sparkle.LinkedInNET/
GNU Lesser General Public License v3.0
35 stars 51 forks source link

I.0.11 has a big problem #6

Closed wtmw closed 8 years ago

wtmw commented 8 years ago

I.0.11 has a big problem

var config = LinkedInApiConfiguration.FromAppSettings("MyDemo.LinkedInConnect"); // OR var config = LinkedInApiConfiguration("api key", "api secret key"); Both ways will popup error message in VS2015

The first method will get-----Severity Code Description Project File Line Suppression State Error CS0117 'LinkedInApiConfiguration' does not contain a definition for 'FromAppSettings' SocialMediaData

The second will get --=-Severity Code Description Project File Line Suppression State Error CS1955 Non-invocable member 'LinkedInApiConfiguration' cannot be used like a method.

sandrock commented 8 years ago

Hi.

First, I suppose you use the new .NET 4.5 build and not the 4.0 one.

FromAppSettings

The 4.5 build does not include the FromAppSettings method. I removed it because the method does not provide anything useful to the developers. It's easy to do it yourself. The method is still available in 4.0 and 3.5 builds and will be obsoleted soon.

var me = new LinkedInApiConfiguration();
me.ApiKey = ConfigurationManager.AppSettings[prefix + "ApiKey"];
me.ApiSecretKey = ConfigurationManager.AppSettings[prefix + "ApiSecretKey"];

API key constructor

Yes. Nice remark. The example is wrong. I missed the new keyword.

var config = new LinkedInApiConfiguration("api key", "api secret key");

Thank you.