English 中文(简体)
如何在伙伴关系中使用外部项目。 NET项目
原标题:How to use external projects in an ASP.NET project
  • 时间:2010-01-15 11:40:21
  •  标签:
  • asp.net

UPDATE : It turned out that the project I was referring to was a console app. Rebuilding it as a class library was the solution.

我猜想,这应当是一个容易的事情:

我只是刚刚开始合作伙伴关系。 该网络现在只需要作为一些快速内联网报告的工具。 我有一个提供数据的现有项目,但我无法在我的网络项目中查阅。

图书馆被称为(例如)Lib,我想测试Utils的静态“Hello World()”方法。 我已将利比项目列入参考文献。 编辑们知道,它在那里造成英特尔利斯群岛正在运行,项目依赖性表明网络项目在Lib上台。

<div>
        <% Response.Write(Lib.Utils.HelloWorld()); %>         
</div>

Compiler Error Message: CS0103: The name Lib does not exist in the current context

当然,我是很新鲜的,但在开门人的例子和辅导中,我没有unt着如何提及外部项目。

感谢!

问题回答

页: 1 Lib in You web Project. 之后在您的网页上添加以下内容:

<%@ Import Namespace="Lib.NameSpace" %>

Lib.Name Space> 是您的Utils类别的实际名称空间。

而应该如此。

http://msdn.microsoft.com/en-us/library/eb44kack.aspx” rel=“nofollow noretinger”>@Import 适当名称空间进入网页。

并且确保你的网站参考资料适当的组装。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签