没有虚拟目录的ASP.NET 3.5网站 [英] ASP.NET 3.5 Web site without virtual directory

查看:62
本文介绍了没有虚拟目录的ASP.NET 3.5网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


首先,我正在尝试部署一个没有虚拟目录的Web应用程序.是的...由于别的技术限制,我别无选择,只能尝试一下.
现在,我已经开发了一个ASP.NET 3.5 Web应用程序,该应用程序可以在本地ASP.NET开发Web服务器上正常工作.然后,我使用VS2008 Publish ...选项将应用程序发布到实际的Web服务器.当我收到一些与web.config相关的错误消息时,我从web.config中删除了相应的项目.
当我可以访问页面但页面内的代码却无法正常工作时.当我打开位于网站正下方的Default.aspx时,我不断收到此错误:
编译器错误消息:CS0246:找不到类型或名称空间名称"DynamicLoadControl"(是否缺少using指令或程序集引用?)

这个DynamicLoadControl是我开发的一个类,它存在于\ App_Code \ DynamicLoadControl.cs文件中(在同一名称空间中).

另外,为了调试,我正在发布整个项目文件夹,并且在.aspx文件中具有以下内容:
<%@页面语言="C#" AutoEventWireup ="true" src ="Default.aspx.cs" Inherits ="MyNamespace.Default"%>
我使用的是src而不是CodeBehind(仅用于调试).

我已经搜索了很多,并尝试了所有操作,除了创建虚拟目录.首先,是否有可能没有虚拟目录的asp.net 3.5网站.如果是这样,摆脱此问题需要什么?
谢谢.

Hi,
First of all, I am trying to deploy a web application, without virtual directory. Yes...I have no other option but to try this due to some non-tehnical constraints.
Now, I have developed an ASP.NET 3.5 Web application, which works fine on my local ASP.NET Development Web Server. Then, I published the application to the actual webserver using the VS2008 Publish... option. When I got some error messages related to web.config, I removed the corresponding items from the web.config.
When I can access the page but the code inside the page doesn''t really work. When I open the Default.aspx, which is directly under the website, I keep on getting this error:
Compiler Error Message: CS0246: The type or namespace name ''DynamicLoadControl'' could not be found (are you missing a using directive or an assembly reference?)

This DynamicLoadControl is a class that I have developed and is present in \App_Code\DynamicLoadControl.cs file (in the same namespace).

Also, for debugging I am publishing entire project folder and I''ve something like this in the .aspx file:
<%@ Page Language="C#" AutoEventWireup="true" src="Default.aspx.cs" Inherits="MyNamespace.Default" %>
I am using src instead of CodeBehind (only for debugging).

I have searched a lot and tried everything except creating a virtual directory. First of all, is it possible to have asp.net 3.5 website without virtual directory. If so, what is it required to get rid of this problem?
Thanks.

推荐答案

将整个网站复制到wwwroot中,然后

首先,查看所有文件夹都在同一层次结构中,即默认网站下只有一个bin,一个app_code和一个app_data文件夹

否则将新创建的dll等移动到默认bin中,并将代码文件移动到app_code等中,其余文件和文件夹将它们原样复制到wwwroot文件夹中

现在,如果您遇到任何其他错误,它应该可以工作,现在您可以根据收到的错误来修复它们.

发布您的异常/错误以获取更多建议.
copy your entire website into the wwwroot and then

first of all see all your folders are in the same hierarchary ie only one bin , one app_code , one app_data folders under the default website

or else move your newly created dll''s etc into the default bin and your code file into app_code etc and remaining files and folders copy them as is into the wwwroot folder

now it should work if you get any other errors now you can fix them basing on the error you get.

post your exceptions/ errors for further suggestions.


这篇关于没有虚拟目录的ASP.NET 3.5网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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