Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

VB.NET script works in 'test map' but not in 'run time'

VB.NET script works in 'test map' but not in 'run time'

VB.NET script works in 'test map' but not in 'run time'

Hello all,

I am a newbie. I am using a scripting functoid with VB.NET script in BizTalk Server 2004. The script executes fine when i use the 'Test Map' mode. But when I actually run my project using Receive/Send ports....it does not. The VB.NET is not installed alongwith BizTalk....is VB.NET required to be installed alongwith BizTalk to execute VB.NET script?


RE: VB.NET script works in 'test map' but not in 'run time'

Well you need to have the .NET Framework installed on your Server. You dont need any Development Environments installed on your Server.

Can you post the error Message in your EventLog? That would be helpful to analyze your error.

Did you script inside your Functoid? Or are you calling an external .dll? If you are using an external .dll make sure you have installed your .dll in the GAC! Other than that I need to see your error Message to be able to help you!

RE: VB.NET script works in 'test map' but not in 'run time'

Thats the weird part...I checked in event log and there is no error message of any sort. It goes through fine when I actually run it but the script does not work since the output does not contain what it should. Just for test purposes, I used this code in a scripting functoid connecting two string fields in a map using inline VB.NET (no external assembly).

Public Function TestInline(ByVal param1 As String) As String
       Return "Test"
End Function

When I test the map using 'Test Map' the output field contains the value 'Test' in the appropriate field. But when i actually run my project (i.e. placing a file in the receive location)...that output field is empty in the output....and there is no error message of any sort. I guess if it works with 'Test Map', it should work in run time but i have no clue why this is happening.

any more ideas?

Thanks for your time

RE: VB.NET script works in 'test map' but not in 'run time'

Without seeing your Project its hard to help. Maybe you want to try this to get some more Information concerning your error:
Put your code in an external helper class and wrap it with a try catch block. Throw an exception in your catch block, to make sure you will get an EventLog entry when an error occures. You could also write some of your values to the eventLog or a Tracing Library or even a file so you can actually have a look at them.

You might gain some more Information on your Problem then.


RE: VB.NET script works in 'test map' but not in 'run time'


I don't know what the problem was but i deleted the whole project and recreated everything. Now the VB.NET script works but only if i do not use any keywords. for e.g. I am using the following Inline VB.NET script (no external assembly)
Dim strStreetName as string
Dim strStreetType as string
Public Function SplitStreetName(ByVal param1 As String) As String
Dim i as integer
Dim aryTextFile() as string

aryTextFile = param1.Split(" ")
strStreetName = ""
strStreetType = ""
For i=0 To UBound(aryTextFile)
    if i < UBound(aryTextFile) Then
     strStreetName = strStreetName + " " + aryTextFile(i)       
    end if
   if i = UBound(aryTextFile) Then
      strStreetType = aryTextFile(i)
  End if
Next i
Return strStreetName
End Function

When i 'Test Map' it...the compiler gives an error saying 'UBound is not declared'. Isn't UBound a keyword in VB.NET and shouldn't it be automatically recognized as such by the compiler? I have this same problem when i use 'MsgBox' too.


RE: VB.NET script works in 'test map' but not in 'run time'

first of all never use MsgBox in a Server Environment! Not even to just print out some variables! Never ever do that! Its a server environment and as soon as pop up a msgbox the coplete process comes to a halt till some user presses a button! Again, Never ever do that!
As I said before, if you need values for debugging reasons write it in the eventLog, in a Tracing Library, write a file or even use the Debug.WriteLine to see the values.

The scripting functoid only allows very easy and small parts of code. My advice is to always use an external assembly and to refernce that from your project. In an external assembly you can code the whole range of any .NET language. Just remember to place the dll Files of your helper assemblies in the GAC.

For example in every Project I create there are a couple of external assemblys providing helper functions to me. (there is an Orchestration Helper, an Mapping Helper,.....)

RE: VB.NET script works in 'test map' but not in 'run time'


As you can see I am a novice programmer but I surely am learning every day to be a better one. Your tips/suggestions have been very helpful.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close