chenneo / google-api-dotnet-client

Automatically exported from code.google.com/p/google-api-dotnet-client
Apache License 2.0
0 stars 0 forks source link

Google.Apis.Services.BaseClientService' is defined in an assembly that is not referenced (Google Analytics) #331

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create Sharepoint 2010 Console app
2. Add references to the latest stable release binary Google files
3. Build 

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

The type 'Google.Apis.Services.BaseClientService' is defined in an assembly 
that is not referenced. You must add a reference to assembly 'Google.Apis, 
Version=1.3.0.15233, Culture=neutral, 
PublicKeyToken=null'.   C:\Users\khodzhaa\Documents\Visual Studio 
2010\Projects\SP_ANALYTICS_APP\Analytics\GoogleAnalyticsHandler.cs  30  41  SP_ANAL
YTICS_APP
. You must add a reference to assembly 'Google.Apis, Version=1.3.0.15233, 
Culture=neutral, PublicKeyToken=null'.

Version of Google.Apis.dll referenced is 1.3.0.15233

Please provide any additional information below.

private static AnalyticsService AuthenticateInfo()
{

            string scopeUrl = "";// ConfigurationManager.AppSettings.Get("scopeUrl");
            string clientEmailId = "";//  ConfigurationManager.AppSettings.Get("clientEmailId");
            string keyFile = "";//  ConfigurationManager.AppSettings.Get("keyFile");
            string keyPass = "";//  ConfigurationManager.AppSettings.Get("keyPass");
            var desc = GoogleAuthenticationServer.Description;
            var key = new X509Certificate2(keyFile, keyPass, X509KeyStorageFlags.Exportable);

            var client = new AssertionFlowClient(desc, key) { ServiceAccountId = clientEmailId, Scope = scopeUrl };
            var auth = new OAuth2Authenticator<AssertionFlowClient>(client, AssertionFlowClient.GetState);
            BaseClientService.Initializer Initializer = new BaseClientService.Initializer();
            var gas = new AnalyticsService(new BaseClientService.Initializer()
            {
                Authenticator = auth,
                ApiKey = ""
            });
            return gas;

//             var auth = new 
OAuth2Authenticator<NativeApplicationClient>(provider, GetAuthentication);
//var service = new XXXService(new BaseClientService.Initializer()
//{
//Authenticator = auth,
//ApiKey = “[DEVELOPER_KEY_HERE]”
//});
        }

Original issue reported on code.google.com by mansur1...@hotmail.com on 28 May 2013 at 7:57

GoogleCodeExporter commented 9 years ago
Can you please also attach the content of your project file?
It will be very helpful to try understand what's happening here.

Thanks,
Eyal

Original comment by pele...@google.com on 29 May 2013 at 3:46

GoogleCodeExporter commented 9 years ago

Original comment by pele...@google.com on 29 May 2013 at 3:47

GoogleCodeExporter commented 9 years ago
Hi Eyal,

attached is SharePoint 2010 Console App (C#).
I'm getting build error in GoogleAnalyticsHandler.cs

Original comment by mansur1...@hotmail.com on 29 May 2013 at 6:54

Attachments:

GoogleCodeExporter commented 9 years ago
Why google analytics dll isn't signed like all the other dlls you have 
reference to?
Is it in purpose?

Original comment by pele...@google.com on 30 May 2013 at 2:41

GoogleCodeExporter commented 9 years ago
I signed all Google dlls with this code

ILDASM Google.XXXXX.dll /out:Google.XXXXX.il
ILASM Google.XXXXX.il /dll /resource=Google.XXXXX.res 
/key=MyCertificate-publickey.snk

The only dll that gave me FAILURE result on signing was 
Google.Apis.Analytics.v3.dll 

Original comment by mansur1...@hotmail.com on 30 May 2013 at 4:55

GoogleCodeExporter commented 9 years ago
what is the failure? I don't have enough experience with signing but it looks 
like you need to sign it as well to make it work

Original comment by pele...@google.com on 30 May 2013 at 6:02