Re: Releasing my VB.NET app over the intranet

From: Peter Huang (v-phuang_at_online.microsoft.com)
Date: 10/11/04


Date: Mon, 11 Oct 2004 09:54:58 GMT

Hi Schoo,

I have searched the web, so far I did not find an article specified for
your scenario.
However, here is my test steps, you may have a try.
1. build the two projects
[Class Library]
Imports System.Data

Public Class Class1
    Friend WithEvents SqlConnection1 As System.Data.SqlClient.SqlConnection
    Public Sub New()
        Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection
        Me.SqlConnection1.ConnectionString = "Password=123;Persist Security
Info=True;User ID=sa;Initial Catalog=Northwind;Data Source=sha-vphuang-05"
    End Sub
    Public Function Test() As Integer
        Me.SqlConnection1.Open()
        Dim cmd As New SqlClient.SqlCommand("select count(*) from
customers", Me.SqlConnection1)
        Dim dr As SqlClient.SqlDataReader = cmd.ExecuteReader
        dr.Read()
        Dim i As Integer = dr.GetInt32(0)
        Me.SqlConnection1.Close()
        Return i
    End Function
End Class

[Winform]
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
        Dim cls As New CallDB.Class1
        MsgBox(cls.Test)
    End Sub

2.build and put the two assemblies(exe and dll) into c:\inetpub\wwwroot

3. use the caspol.exe tool to disable the clr security check to simplify
the troubleshooting.
http://msdn.microsoft.com/library/en-us/cptools/html/cpgrfcodeaccesssecurity
policyutilitycaspolexe.asp
run commandline
caspol -s off

4. open ie and run the url
http://localhost/testwinapp.exe

5.click the buttion the msgbox will return the record count.

If the test program still did not work on your machine, I think you may try
to test the application on another machine or you may need to reinstall
net framework and update IE to the newest version.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.