Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using SubSonic in a VB.NET web application

I am using SubSonic in a VB.NET application for the first time (I have used it successfully in a WebSite project plenty of times). I followed the second 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#.

Here is the process I followed:

  1. I created a blank Web Application Project in Visual Studio
  2. I configured the web.config file 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 Project
  5. I opened up a code behind, typed 'Imports' and I do not see the namespace that was generated.

I have even opened the actual Subsonic source files and have 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 file and use that in my project, but it still did not work.

What might I be doing wrong?


2 Answers

The trick is when you are generating your DAL in SubCommander, you must specify a /lang vb argument. My final arguments list looked like this:

generate /out DAL /lang vb

Then it gives me my DAL code in VB.NET and that works just fine with everything I've got.

I've done it many times. My command line is:

generate /out Classes\DAL /lang vb
like image 31
Rick Rat Avatar answered Mar 03 '26 20:03

Rick Rat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!