1. 装了GuidanceAutomationToolkitForVS2008.msi和WCSF, 从VSS获取别人建好的项目,由于别人的安装路径可能与自已的不同, 在
Add Business Module时,会出现找不到一些企业库的DLL, 此时,只成功的加了
ModuleInitializer/Controller/DefaultViewPresenter和各自的interface file, 但WebForm模块下没有成功加入文件, 编译也不通
过,解决此问题办法如下:
1). 最简单的办法,可以在solution的根目录下手动建文件夹Library,把用到的几个企业库DLL复制到下边,把刚没建好的Business
Module删除,重建一次就可解决.
2). 在没建好的Business Module基础上手动进行下去,在Buiness Module里添加所需的那几个企业库DLL引用,到WebSites那边加和
Business Module同名的文件夹,再右击些文件夹,执行Web Client Factory-->Add Page(with presenter)C#, 随便给页面一个名字
,假如叫UserList.aspx, 这样会自动的在刚才的Business Module下的Views文件夹加上UserListPresenter和IUserListView两个类
,当然这个页面代码里也会自动继承IUserListView。编译通过,但运行时会出现错误
错误message:
Service Microsoft.Practices.CompositeWeb.Interfaces.ISiteMapBuilderService is not available in the current context.
对比了一下能正常运行的项目,发现在WebSites下和Business Module同名的子文件夹下少了一个web.config文件,把它加上,内容
如下
<configuration>
<configSections>
<sectionGroup name="compositeWeb">
<section name="modules" type="Microsoft.Practices.CompositeWeb.Configuration.ModulesConfigurationSection,
Microsoft.Practices.CompositeWeb"/>
<section name="authorization"
type="Microsoft.Practices.CompositeWeb.Configuration.AuthorizationConfigurationSection,
Microsoft.Practices.CompositeWeb"/>
</sectionGroup>
</configSections>
<compositeWeb>
<modules>
<module name="UserMaint" assemblyName="UserMaint" virtualPath="~/UserMaint">
<dependencies>
<dependency module="Shell" />
</dependencies>
</module>
</modules>
<authorization>
<!-- Add your own view-rule mappings here:
e.g.:
<rule Url="~/HelloWorld/Default.aspx" Rule="AllowAccessHelloWorldDefaultView" />
-->
</authorization>
</compositeWeb>
<appSettings/>
<connectionStrings/>
<system.web />
</configuration>
修改当中的<module name="UserMaint" assemblyName="UserMaint" virtualPath="~/UserMaint">就可以了