问题描述
我第一次在VB.net应用程序中使用Subonic(我已经在WebSite项目中成功使用了很多次).我按照入门"视频的第二部分实际生成了DAL源文件,而不是生成提供程序方法,并且所有APPEARS都按预期运行.但是,我所做的任何事情都不会使我生成的命名空间出现.我觉得这与我在VB.Net中运行Web应用程序以及Subsonic在C#中生成事实有关.
I am using Subonic in a VB.net application for the first time (I have used it succesfully in a WebSite project plenty of times). I followed the 2nd part of the 'Getting Started' video to actually generate the DAL source files as opposed to the build provider method and everything APPEARS to have gone like expected. However, nothing I do will get my generated namespace to appear. I feel that it has to with the fact that I am running my Web Application in VB.Net and Subsonic generates in C#.
这是我遵循的过程:
1)我在Visual Studio中创建了一个空白的Web应用程序项目2)我将web.config配置为具有必要的部分,连接字符串等.3)我运行了副指挥官,它生成了我需要的所有类到一个名为DAL的文件夹中.4)我建立了Web应用程序项目5)我在后面打开了一个代码,键入导入",但看不到生成的名称空间.
1) I created a blank Web Application Project in Visual Studio2) I configured the web.config to have the necessary parts, connection strings, etc.3) I ran subcommander and it generated all the classes I needed into a folder called DAL.4) I built the Web Application Project5) I opened up a code behind, typed 'Imports' and I do not see the namespace that was generated.
我什至已经打开了实际的Subsonic Source文件,并看到有一个我配置的生成名称空间的名称空间语句.我曾尝试将亚音速文件移动到一个单独的类库项目,编译.dll并在我的项目中使用它,但仍然无法正常工作.
I have even opened the actual Subsonic Source files and seen that there is a namespace statement for the generated namespace I configured. I tried briefly to move the subsonic files to a separate class library project, compile the .dll and use that in my project, but it still did not work.
有人对我可能做错的事情有任何想法吗?
Does anyone have any thoughts on what I might be doing wrong?
谢谢
迈克
推荐答案
当然,
我发布问题的那一刻,我就能找到答案.诀窍在于在SubCommander中生成DAL时,必须指定/lang vb参数.我的最终参数列表如下所示:
The instant I post a question I am able to find the answer. The trick is when you are generating your DAL in SubCommander and you must specify a /lang vb argument. My final arguments list looked like this:
生成/out DAL/lang vb
generate /out DAL /lang vb
然后它在VB.net中给了我DAL代码,并且对我所拥有的一切都可以正常工作.
Then it gives me my DAL code in VB.net and that works just fine with everything I've got.
迈克
这篇关于在VB.Net Web应用程序中使用SubSonic的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!