如何在本地IIS上托管具有引用的DLL文件的网站 [英] How to host a website with referenced DLL files on Local IIS

查看:396
本文介绍了如何在本地IIS上托管具有引用的DLL文件的网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我花了几天时间试图自己解决这个问题,但现在还没有成功,我现在处于疯狂的边缘。



基本上,我创造了我的Windows 7计算机上的Visual Studio 2012中的项目。在这个项目中,我有一个业务逻辑层,数据访问层,业务对象层(都是类库)和一个名为UI的网站。 UI中引用了BLL,BOL和DAL dll,这些DLL文件位于UI的bin文件夹中。 UI被设置为启动项目,当我在Visual Studio中使用F5查看时,网站运行没有问题。



问题是我将网站内容复制到wwwroot我的inetpub的文件夹。我收到如下错误:



 服务器 错误 '/'应用程序中。 

编译 错误

描述: 错误 编译期间,>发生了 span> a 资源 required to service 请求 review 关注 具体 错误 详细信息 修改 您的 source code 恰当

编译器 错误 消息: CS0246: type 名称空间 名称'BLL' 找到 缺失 a 使用 指令 < span class =code-leadattribute>或
汇编参考?)

来源 错误:


5: using System Web .UI;
6: 使用 System Web UI .WebControls;
7: 使用 BLL;
8: 使用 BOL;
9: 使用 DAL;

来源 文件: c:\inetpub \wwwroot \ WorkshopWebApp \Default。 aspx cs 行: 7





请注意,所有dll文件都在bin中位于inetpub wwwroot文件夹中的网站文件夹的文件夹,我也在myy本地计算机上运行IIS。我已经尝试了很多东西来解决这个问题,但没有成功。任何帮助都将受到高度赞赏。

解决方案

为安全起见IIS块引用DLL,默认情况下为exe

几乎所有托管服务提供商都会阻止它们您应该在您的网站中包含源代码。


如果您将文件传入iis根目录,那么它将具有默认的应用程序池。它可能是.net framework 2.0

您需要在IIS中创建新的Web应用程序/站点并设置您的asp.net站点所针对的应用程序池。如果您不理解这些术语,请阅读有关IIS中asp.net部署的文档教程。

在IIS 7.0上部署ASP.NET网站 [ ^ ]

http://stackoverflow.com/questions/4890245/how-to-add-asp-net-4-0-as-application-pool-on-iis-7-windows-7 [ ^ ]

为ASP.NET应用程序部署和SQL Server 2008集成配置IIS 7 [ ^ ]

I have spent days trying to solve this problem on my own but not been successful now I am at the verge of going crazy.

Basically, I have created a Project in Visual Studio 2012 on my Windows 7 machine. In this project, I have a Business Logic Layer , Data Access Layer , Business Objects Layer(which are all class libraries) and a Website I called UI. The BLL, BOL and DAL dll's are referenced in the the UI and these DLL files are in the bin folder of UI. The UI was set as startup project and the website runs without issue when I view it using F5 in Visual studio.

The problem is when I copy the Website content into wwwroot folder of my inetpub. I get the following error shown below :

Server Error in '/' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0246: The type or namespace name 'BLL' could not be found (are you missing a using directive or an assembly reference?)

Source Error:


Line 5:  using System.Web.UI;
Line 6:  using System.Web.UI.WebControls;
Line 7:  using BLL;
Line 8:  using BOL;
Line 9:  using DAL;

Source File: c:\inetpub\wwwroot\WorkshopWebApp\Default.aspx.cs    Line: 7



Please note that all the dll files are in the bin folder of the Website folder located in the inetpub wwwroot folder and I also have IIS running on myy local machine. I have tried so many things to solve this but without success. Any help will be highly appreciated.

解决方案

for security reason IIS block referring DLL, exe by default
Almost all hosting provider will block them too
You should include the source code in your website.


if you past files in to iis root then it will have the default application pool. it may be .net framework 2.0
you need to create new web application/site in your IIS and set the app pool which you have target your asp.net site. If you not understand these terms please read documentations tutorials about asp.net deployment in IIS.
Deploying ASP.NET Websites on IIS 7.0 [^]
http://stackoverflow.com/questions/4890245/how-to-add-asp-net-4-0-as-application-pool-on-iis-7-windows-7[^]
Configuring IIS 7 for ASP.NET Applications Deployment and SQL Server 2008 Integration[^]


这篇关于如何在本地IIS上托管具有引用的DLL文件的网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆