none
Missing reference or namespace RRS feed

  • Question

  • I have created a project name FreebaseAPiService to access freebase api of google using Google.Apis.Freebase.v1  and

    This FreebaseAPIService is refereneced in my businesslayer.

    while using this freebaseapiservice and building the solution, 

    it says Missing assembly reference in the business layer.

    the code blocks are attached.

    using System;
    using System.Collections.Generic;
    using System.Configuration;
    using Google.Apis.Freebase.v1;
    using Google.Apis.Services;
    
    namespace AASD_FreebaseAPI
    {
        public class FreeBaseAPI
        {
            private static string apiKey;
            private static string appName;
            private static FreebaseService service;
            private static volatile FreeBaseAPI instance;
            private static object syncRoot = new Object();
    
    
            public static FreeBaseAPI Instance
            {
                get
                {
                    if (instance == null)
                    {
                        lock (syncRoot)
                        {
                            if (instance == null)
                                instance = new FreeBaseAPI();
                        }
                    }
    
                    return instance;
                }
            }
    
            private FreeBaseAPI()
            {
                apiKey = ConfigurationSettings.AppSettings["API_Key"];
                appName = ConfigurationSettings.AppSettings["Application_Name"];
            }
    
            /// <summary>
            /// retrieves context from freebase APi service
            /// </summary>
            /// <param name="query">query search</param>
            /// <param name="context">context from user</param>
            /// <returns> whole ratings of freebase</returns>
            public IList<string> GetFreeBaseServiceResults(string query, string context)
            {
                DataResultFreeBase obj = null;
                IList<string> p = null;
                try
                {
                    service = new FreebaseService(new BaseClientService.Initializer
                    {
                        ApplicationName = appName,
                        ApiKey = apiKey,
                    });
    
                    using (service)
                    {
                        //// Run the request.
                        Console.WriteLine("Executing a list request...");
                        FreebaseService.SearchRequest v = new FreebaseService.SearchRequest(service);
                        string queryJson = "{'id':" + query + ",'name':" + query + ",'type':/" + context + "}";
                        v.Query = queryJson;
                        var res = v.Execute();
                        //Newtonsoft.Json.Linq.JObject jObject = Newtonsoft.Json.Linq.JObject.Parse(res);
                        obj = CommonUtility.Deserialize<DataResultFreeBase>(res);
    
                        if (obj != null && obj.result != null && obj.result.Count > 0)
                        {
                            obj.result.ForEach(x =>
                            {
                                p.Add(x.name);
                            });
                        }
                    }
                }
                catch (Exception e)
                {
                    throw e;
                }
    
                return p;
            }
    
        }
    }
    

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using AASD_BingServiceAPI;
    using AASD_BingServiceAPI.DTOs;
    using AASD_BuisnessLayer.Entities;
    using AASD_FreebaseAPI;
    
    namespace AASD_BuisnessLayer.BusinessGateways
    {
        /// <summary>
        /// This helps Connect to different  layer and all necessary translation happens here
        /// </summary>
        public class BusinessGateway
        {
           
            public IList<string> ConsumingFreeBaseApi(Query request)
            {
                IList<string> contextList = null;
    
                contextList = FreeBaseAPI.Instance.GetFreeBaseServiceResults(request.SearchQuery, request.Context);
                return contextList;
            }
        }
    }
    

    Please acknowledge ASAP.

    Regards,

    Santosh

    Saturday, June 28, 2014 11:10 PM

Answers

  • Santosh,

    Sorry but you have posted to a forum that deals exclusively with questions/issues about Microsoft Project, a planning and scheduling application. I suggest you delete this post and find a more appropriate forum.

    John

    Saturday, June 28, 2014 11:48 PM