找不到类型或名称空间名称“ HSFProvider”(您是否缺少using指令或程序集引用?)

时间:2019-08-20 10:01:45

标签: c# .net visual-studio jenkins build

您好所有jenkins构建都因错误而失败

COMWrapper.cs(4,7):错误CS0246:找不到类型或名称空间名称“ HSFSVProviderLib”(您是否缺少using指令或程序集引用?)[C:\ Jenkins \ jobs \ StrategicModeling \ branchs \ develop \ workspace \ HSFRoot \ HSFWebServicesRoot \ HSFCOMFactory \ HSFCOMFactory.csproj]

COMWrapper.cs(12,16):错误CS0246:找不到类型或名称空间名称“ HSFProvider”(您是否缺少using指令或程序集引用?)

我已经提到了以下代码。请帮助我修复它。

using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using HSFSVProviderLib;
namespace HSFCOMFactory
{
public class COMWrapper
{
    public HSFProvider m_HSFComObj = null;
    private string m_sSessionID = "";

    public COMWrapper()
    {
        if (m_HSFComObj == null)
        {
            m_HSFComObj = new HSFProvider();
        }
    }

    public void SetLocaleName(string name)
    {
      m_HSFComObj.SetLocaleName(name);
    }

    public void SetURL(string sURL)
    {
      m_HSFComObj.SetURL(sURL);
    }

    public void SetCookie(string sCookie)
    {
      m_HSFComObj.SetCookie(sCookie);
    }

    public void SetSessionID(string sessionID)
    {
        m_sSessionID = sessionID;
    }

    public string getSessionID()
    {
      return m_sSessionID;
    }

    public string getRealSessionID()
    {
        //  Discard the fake session ID for offline work, since we're going to go to the Server with this.
        if ( m_sSessionID.Equals("HSFOffline", StringComparison.InvariantCultureIgnoreCase))
        {
            return "";
        }

        return m_sSessionID;
    }

    public string ExecuteRequest(string sRequest, bool bAppendSessionID = true)
    {
        if (bAppendSessionID)
        {
            try
            {
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.LoadXml(sRequest);

                XmlNode root = xmlDoc.DocumentElement;
                XmlNode sessionIDNode = root.SelectSingleNode( "sID" );

                if ( sessionIDNode == null ) {
                  XmlElement sIDElem = xmlDoc.CreateElement( "sID" );
                  sIDElem.InnerText = m_sSessionID;
                  root.PrependChild( sIDElem );

                  sRequest = xmlDoc.InnerXml;
                }
            }
            catch(Exception e)
            {
 //               GUIObjects.Logging.Log(" Exception COMWrapper - ExecuteRequest: " + e.Message + " request " + sRequest);
                string errXML = "<error>Exception while trying to append sessionID to the request : ";
                errXML += e.Message;
                errXML += "</error>";
                return errXML;
            }
        }

        string sRequestForPing = "<req_Ping>";
        string sRequestLower = sRequest.ToLower();

        System.Diagnostics.Debug.WriteLine("PSPS COM Request:" + sRequestLower);

        if (sRequestLower.Contains("req_getformslice"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_GetFormSlice</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("req_listentities"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_ListEntities</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("req_listdocuments"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_ListDocuments</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("check_out"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_Checkout</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("check_in"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_Checkin</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("save"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_Save</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("save_as"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_SaveAs</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("create_initial_time"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_CreateInitialTime</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("time_add_years"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_TimeAddYears</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("time_detail"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_TimeDetail</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("delete_yrs"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_DeleteYrs</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("insert_account"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_InsertAccount</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("set_report_format"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_SetReportFormat</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("open_consolidation"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_OpenConsolidation</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("close_consolidation"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_CloseConsolidation</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("set_time_info"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_SetTimeInfo</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("get_dataview_info"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_DATAVIEWS</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("get_forecast_info"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_AccountForecast</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("get_dimension_maintenance_info"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_DimensionsMaintainance</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("get_assign_dimension_info"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_DimensionsAssignDimension</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("get_subaccount_info"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_SubAccounts</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("get_user_defined_account_info"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_UserDefinedAccount</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("get_group_info"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_AccountGroups</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("get_where_used"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_WhereUsed</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("depreciation_scheduler_info"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_DepreciationScheduler</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("get_goalseek_info"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_GoalSeek</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("get_scenario_info"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_ScenarioManager</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("get_sensitivity_info"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_SensitivityAnanlysis</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("has_deal_pd"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_Time</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("any_debt_schedules"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_DebtSchedule</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("get_audit_trail_info"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_AuditTrail</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("initialize_translator"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_CurrencyTranslator</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("update_links_values"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_Calculate</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("is_calced"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_CalculateAllScenarios</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("get_tv_info"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_TaxAndValueOptions</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("get_alias_info"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_ReportsAliasManager</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("list_reports"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_ListReports</SVFeatureTracking>";
        }
        else if (sRequestLower.Contains("insert_report"))
        {
            sRequestForPing += "<SVFeatureTracking>SV_ReportsInsertSheet</SVFeatureTracking>";
        }

        sRequestForPing += "</req_Ping>";
        //TODO PRASHANT - what if the ping request returns exception? What do we do?
        m_HSFComObj.ExecuteRequest(sRequestForPing);
        return m_HSFComObj.ExecuteRequest(sRequest);
    }

    public bool ExecuteRequest(string sRequest, out string sResponse, bool bAppendSessionID = true)
    {
        try
        {
            sResponse = ExecuteRequest(sRequest, bAppendSessionID);

            return (sResponse == "") ? false : true;
        }
        catch
        {
   //        GUIObjects.Logging.Log(" Exception - ExecuteRequest: " + sRequest + " returning empty response. ");
            sResponse = "";
            return false;
        }
    }
}

}

0 个答案:

没有答案