Note that there are some explanatory texts on larger screens.

plurals
  1. POcast problem from class to interface
    text
    copied!<pre><code>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&lt;Advertisements&gt; ApplyQueries(string searchQuery, int page, int pageSize, string orderBy, out int count); } public class SlovenianSearchQueryManager : ISearchQueryManager { ... } </code></pre> <p>but i get </p> <p>Unable to cast object of type 'Logic.SlovenianSearchQueryManager' to type 'Logic.ISearchQueryManager'.</p> <p>EDIT: whole stacktrace</p> <blockquote> <p>System.InvalidCastException was unhandled by user code<br> Message="Unable to cast object of type 'Logic.SlovenianSearchQueryManager' to type 'Logic.ISearchQueryManager'."<br> Source="ViaMura.Web.Module"<br> StackTrace: at ViaMura.Web.Module.WebController.GetAdvertismentsByRawQuery(String rawQuery, Int32 page, Int32 pageSize, String orderBy, Int32&amp; count) in D:\PROJEKTI\crawler\WebCrawlerSuite\ViaMura.Web.Module\WebController.cs:line 32 at ViaMura.Web.Module.Views.SearchResultsPresenter.OnResultsLoad(Int32 page, Int32 pageSize, String orderBy) in D:\PROJEKTI\crawler\WebCrawlerSuite\ViaMura.Web.Module\Views\SearchResultsPresenter.cs:line 43 at ViaMura.Web.SearchResults.SearchAdvertisments() in D:\PROJEKTI\crawler\WebCrawlerSuite\ViaMura.Web\SearchResults.aspx.cs:line 155 at ViaMura.Web.SearchResults.Page_Load(Object sender, EventArgs e) in D:\PROJEKTI\crawler\WebCrawlerSuite\ViaMura.Web\SearchResults.aspx.cs:line 149 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at ViaMura.Web.App_Code.PageControllers.BasePage.OnLoad(EventArgs e) in D:\PROJEKTI\crawler\WebCrawlerSuite\ViaMura.Web\App_Code\PageControllers\BasePage.cs:line 89 at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)<br> InnerException:</p> </blockquote> <p>EDIT2:</p> <pre><code>string a1 = typeof (ISearchQueryManager).Assembly.Location; string a2 = typeof(SlovenianSearchQueryManager).Assembly.Location </code></pre> <p>give me the same result:</p> <blockquote> <p>C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\5438a399\53975f83\assembly\dl3\0f9540b5\15407fe2_5db7cb01\Logic.DLL</p> </blockquote> <p>but </p> <pre><code>string a3 = queryManagerType.Assembly.Location; </code></pre> <p>gives me different path:</p> <blockquote> <p>D:\PROJEKTI\crawler\WebCrawlerSuite\WebCrawler.Logic\bin\Debug\WebCrawler.Logic.dll</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload