Assembly assembly = Assembly.LoadFrom("Logic\\bin\\Debug\\Logic.dll");
Type queryManagerType = assembly.GetType("Logic." + HttpContext.Current.Session["lang_name"] + "SearchQueryManager");
var queryManager = (ISearchQueryManager)Activator.CreateInstance(queryManagerType);
public interface ISearchQueryManager
{
IList<Advertisements> ApplyQueries(string searchQuery, int page, int pageSize, string orderBy, out int count);
}
public class SlovenianSearchQueryManager : ISearchQueryManager
{
...
}
arayüz ama 'Logic.ISearchQueryManager' yazın döküm sorun
türü 'Logic.SlovenianSearchQueryManager' nesne döküm edilemiyor
alır.DÜZENLEME: Bütün StackTrace
System.Web.HttpUnhandledException kullanıcı kodu tarafından işlenmeyen olduğu
Mesaj = " türü 'Logic.ISearchQueryManager' için tip amacı 'Logic.SlovenianSearchQueryManager' döküm edilemiyor"
Kaynak = "ViaMura.Web.Module"
StackTrace: ViaMura.Web.Module.WebController.GetAdvertismentsByRawQuery de (dize rawQuery, Int32 sayfa, ınt32 pageSize, Dize orderBy, Int32 & sayımı) D: \ PROJEKTI \ paletli \ WebCrawlerSuite \ ViaMura.Web.Module \ WebController.cs: hattı ViaMura.Web.Module.Views.SearchResultsPresenter.OnResultsLoad de (Int32 sayfa ınt32 pageSize, dize orderBy) D: \ PROJEKTI \ paletli \ WebCrawlerSuite \ ViaMura.Web.Module \ Views \ SearchResultsPresenter.cs: satır , ViaMura.Web.Searc hResults.SearchAdvertisments() D: \ PROJEKTI \ paletli \ WebCrawlerSuite \ ViaMura.Web SearchResults.aspx.cs \: D ViaMura.Web.SearchResults.Page_Load (Obje gönderen, EventArgs e) hat : \ PROJEKTI \ paletli \ WebCrawlerSuite \ ViaMura.Web SearchResults.aspx.cs \: System.Web.Util.CalliHelper.EventArgFunctionCaller satır (IntPtr fp, nesne o nesne t, EventArgs e) System'de . Web.Util.CalliEventHandlerDelegateProxy.Callback (Object sender, EventArgs e) System.Web.UI.Control.OnLoad de (EventArgs e) ViaMura.Web.App_Code.PageControllers.BasePage.O de nLoad D (EventArgs e): \ PROJEKTI \ paletli \ WebCrawlerSuite \ ViaMura.Web \ App_Code \ PageControllers BasePage.cs \: satır 89 System.Web.UI.Control.LoadRecursive de() System.Web de . UI.Page.ProcessRequestMain (Boolean includeStagesBeforeAsyncPoint, Boole includeStagesAfterAsyncPoint)
InnerException:
EDIT2:
string a1 = typeof (ISearchQueryManager).Assembly.Location;
string a2 = typeof(SlovenianSearchQueryManager).Assembly.Location
bana aynı sonucu verir:
C: \ Windows \ Microsoft.NET \ Framework \ v2.0.50727 53975f83 \ 5438a399 \ Temporary ASP.NET Files \ root \ montaj \ \ dl3 \ 0f9540b5 \ 15407fe2_5db7cb01 \ Mantık.DLL
ama
string a3 = queryManagerType.Assembly.Location;
bana farklı bir yol sunar:
D: \ PROJEKTI \ paletli \ WebCrawlerSuite \ WebCrawler.Logic bin \ \ Debug \ WebCrawler.Logic.dll
tam durum yığını izlemesi gönderin. İki farklı derlemede tanımlanmış olan bu "ISearchQueryManager" arayüzüne sahip olduğunuzdan şüpheleniyorum. –
@Darin veya iki ad alanı –