开发平台都是vs2005,开发人员甲开发了网站系统A,开发人员乙开发网站系统B,两个系统App_Code下都有文件,都有自己的Web.config。
现在需要将A、B两个系统合并,让B作为A的一个子系统,并且希望B能够相对独立。现在的思路是将B系统放在一个子文件夹里,使用自己的Web.config。
现在B系统普通的页面都可以显示了,就是调用App_Code下代码的页面会报错,错误信息类似如下:
Server Error in '/' Application.
--------------------------------------------------------------------------------Could not load type 'ClsApp' from assembly 'App_Code, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.TypeLoadException: Could not load type 'ClsApp' from assembly 'App_Code, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 其中ClsApp是B系统中App_Code下的一个公共类,问题貌似是没有找到B系统bin\App_Code.dll。
请问如何解决这个问题?这个思路是否可行?多谢!
现在需要将A、B两个系统合并,让B作为A的一个子系统,并且希望B能够相对独立。现在的思路是将B系统放在一个子文件夹里,使用自己的Web.config。
现在B系统普通的页面都可以显示了,就是调用App_Code下代码的页面会报错,错误信息类似如下:
Server Error in '/' Application.
--------------------------------------------------------------------------------Could not load type 'ClsApp' from assembly 'App_Code, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.TypeLoadException: Could not load type 'ClsApp' from assembly 'App_Code, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 其中ClsApp是B系统中App_Code下的一个公共类,问题貌似是没有找到B系统bin\App_Code.dll。
请问如何解决这个问题?这个思路是否可行?多谢!
解决方案 »
- 急!急!急!——flash图片预览
- 在一个页面当中只有一个FORM好,还是并列多个FORM好
- 怎么将IP地址转换为10位的字符串
- 怎么把datagrid里的模版列里的的button的type修改掉?
- 如何在程序中控制网站的有效连接数(也即用户数控制)?
- 在库中查找大于某个日期的日期型字段,SQL语名如何写
- 看到别人网站的一个好的图片效果就不知道怎么做就自己想了做了个
- 想换个环境,请在深圳、上海、北京的朋友给点建议
- System.Web.mail 服务器要怎么样配置才能正确发信?
- 这里老是出现什么服务器忙,我点一半天提问才总算出来一次,有什么地方好点的有关论坛,推荐推荐如何?
- textbox和button事件
- 断点上传文件
将B系统的App_Code并在A系统的App_Code内.
将B系统的Web.config并在A系统的Web.config内.
以上做法是可行的.......关于楼主的做法:
我觉得也可行,但要做一些改进:
思路如下:
将B系统的App_Code改个名字.这是个类包,不要与A的类包同名名
将B系统指定到B系统的web.config.如果有两个web.config服务器不知道应用哪一个
(但我总系统一个虚拟机中只能用一个web.config,所以指定不到就把两个web.config合成一个吧)
在a网站下建一个虚拟目录.放B网站就OK
如果是这样的话,我们可以把其中的一个项目的代码文件不编译成App_Code.dll,
我们可以通过设置codeSubDirectories来实现:
假设我们要对项目A进行修改:
1. 在App_Code下新建文件夹NewFolder1,然后将App_Code下所有的.cs文件全部移到NewFolder1下面;
2. 修改A项目的web.config:
在compilation节点下,添加:
<codeSubDirectories>
<add directoryName="NewFolder1"/>
</codeSubDirectories>
这样编译后的dll将会是App_SubCode_NewFolder1.dll,而不是App_Code.dll