【发布时间】:2016-12-14 02:37:57
【问题描述】:
我想从 Windows 窗体应用程序访问 Web 应用程序的根 url。
string rooturl = Billing_XML_WebTracking.WebForm1.RootUrl;
string url = rooturl + "/WebForm1.aspx";
webBrowser1.Navigate(url);
所以我在 Web 应用程序的 Web.config 中添加了以下代码:
<assemblies>
<add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</assemblies>
而Web.config文件的最终代码是
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</assemblies>
</compilation>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
</system.web>
</configuration>
但是在构建解决方案时,它给出了以下错误 “System.Web.UI.Page”类型是在未引用的程序集中定义的。您必须添加对程序集 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 的引用。
请帮帮我。谢谢
【问题讨论】:
-
将程序集“System.Web”的引用添加到您的 winforms 项目中
标签: c# asp.net-mvc winforms