I am using a call application that has a button with the=20
following code to have the windows application sitting on=20
the web server come up.=20

Private Sub Button1_Click(ByVal sender As System.Object,=20
ByVal e As System.EventArgs) Handles Button1.Click=20
Try=20
Dim formAsm As [Assembly] =3D [Assembly].LoadFrom=20
("http://SERVER/Cusip/CusipWindows.exe")=20
Dim formtype As Type =3D formAsm.GetType
("CusipChangeWindows.Form1")=20

Dim FormObj As Object=20
FormObj =3D Activator.CreateInstance(formtype)=20
Dim Form1 As Form =3D CType(FormObj, Form)=20
Form1.Show()=20
Catch ex As Exception=20
MsgBox(ex.Message)=20
End Try=20
End Sub=20

When I press the button I get an error on the=20
CreateInstance line ("Exception has been thrown by the=20
target of an invocation"). Listed below is the code from=20
the windows application. I setup the application under=20
the inetpub/wwwroot folder and gave it script only=20
executable permission and I put the data layer dll in the=20
GAC with a strong name. I also setup the server as a=20
trusted site on my machine and changed the security=20
policy for trusetd sites to meduim using the .NET wizard.=20
I don't know what else to try to get this application to=20
run. I also ran the application right from the browser=20
without the intermediary application and I got this=20
error:=20

"An unhandled exception of=20
type 'System.Security.SecurityException' occurred in=20
IEExec.exe=20

Additional information: Request for the permission of=20
type System.Security.Permissions.SecurityPermission,=20
mscorlib, Version=3D1.0.5000.0, Culture=3Dneutral,=20
PublicKeyToken=3Db77a5c561934e089 failed."=20

Code:=20
*****************************************************=20
Imports Microsoft.ApplicationBlocks.Data=20
Imports System.Security.Principal.WindowsIdentity=20
Imports System.Configuration=20

Public Class Form1=20
Inherits System.Windows.Forms.Form=20
Private dsCusip As New DataSet=20
Private CusipTable As New DataTable=20
Private iChange As Byte=20
Private MyString As String =3D GetCurrent.Name() 'Gets the=20
windows user=20
Private User As String =3D MyString.Remove(1, 11)=20
Private configFile As String =3D Application.ExecutablePath=20
& ".config"=20
Private strConnection As String=20

Private Function SaveNewChange(ByVal OrigCusip As String,=20
ByVal NewCusip As String, ByVal effdt As Date, ByVal=20
Commnt As String) As Boolean=20
Try=20
' Set up parameters (4 input)=20
Dim arParms() As SqlClient.SqlParameter =3D New=20
SqlClient.SqlParameter(4) {}=20
arParms(0) =3D New SqlClient.SqlParameter("@OrigCusip",=20
SqlDbType.Char, 15)=20
arParms(0).Value =3D OrigCusip=20
arParms(1) =3D New SqlClient.SqlParameter("@NewCusip",=20
SqlDbType.Char, 15)=20
arParms(1).Value =3D NewCusip=20
arParms(2) =3D New SqlClient.SqlParameter("@EffDate",=20
SqlDbType.DateTime)=20
arParms(2).Value =3D effdt=20
arParms(3) =3D New SqlClient.SqlParameter("@User",=20
SqlDbType.VarChar, 15)=20
arParms(3).Value =3D User=20
arParms(4) =3D New SqlClient.SqlParameter("@Comments",=20
SqlDbType.VarChar, 2000)=20
arParms(4).Value =3D Commnt=20

Dim Reader =3D SqlHelper.ExecuteReader(strConnection,=20
CommandType.StoredProcedure, "Cusip_CusipChangeSave",=20
arParms)=20

While Reader.Read=20
MsgBox(Reader.Item("Status"))=20
End While=20

'set the changed flag=20
iChange =3D 0=20
Catch ex As Exception=20
MsgBox(ex.Message)=20
End Try=20
End Function=20

Private Sub btnSave_Click(ByVal sender As System.Object,=20
ByVal e As System.EventArgs) Handles btnSave.Click=20
If txtOrigCusip.Text <> "" And txtNewCusip.Text <> ""=20
Then=20
SaveNewChange(txtOrigCusip.Text, txtNewCusip.Text,=20
dtEffDate.Value, txtComments.Text)=20
End If=20
End Sub=20

Public Sub getChanges()=20
Dim connection As SqlClient.SqlConnection =3D Nothing=20

If iChange =3D 0 Then=20
Try=20
connection =3D GetConnection(strConnection)=20
Catch ex As Exception=20
MessageBox.Show("The connection with the database can=B4t=20
be established", "Application Error",=20
MessageBoxButtons.OK, MessageBoxIcon.Error)=20
Exit Sub=20
End Try=20

Try=20
SqlHelper.FillDataset(connection,=20
CommandType.StoredProcedure, "Cusip_PamCusipChanges",=20
dsCusip, New String() {"Cusips"})=20
CusipTable =3D dsCusip.Tables("Cusips")=20
DataGrid1.DataSource =3D dsCusip.Tables("Cusips")=20

'set the changed flag=20
iChange =3D 1=20
Catch ex As Exception=20
MsgBox(ex.Message)=20
End Try=20
End If=20
End Sub=20

Private Sub TabControl1_Click(ByVal sender As Object,=20
ByVal e As System.EventArgs) Handles TabControl1.Click=20
Dim i As Int32 =3D TabControl1.SelectedIndex=20
If i =3D 1 Then=20
getChanges()=20
End If=20
End Sub=20

Private Sub btnDelete_Click(ByVal sender As=20
System.Object, ByVal e As System.EventArgs) Handles=20
btnDelete.Click=20
Dim connection As SqlClient.SqlConnection =3D Nothing=20
Dim ErrorMsg As String=20

Try=20
connection =3D GetConnection(strConnection)=20
Catch ex As Exception=20
MessageBox.Show("The connection with the database can=B4t=20
be established", "Application Error",=20
MessageBoxButtons.OK, MessageBoxIcon.Error)=20
Exit Sub=20
End Try=20

'Create the command that will be used for insert=20
operations=20
Dim insertCommand As SqlClient.SqlCommand =3D=20
SqlHelper.CreateCommand
(connection, "Cusip_CusipChangeSave", "OrigCusip", "NewCus
ip", "EffDate", "User", "Comments")=20

'Create the command that will be used for update=20
operations=20
Dim updateCommand As SqlClient.SqlCommand =3D=20
SqlHelper.CreateCommand
(connection, "Cusip_UpdateCusipChanges", "ID")=20

'Create the command that will be used for delete=20
operations=20
Dim deleteCommand As SqlClient.SqlCommand =3D=20
SqlHelper.CreateCommand
(connection, "Cusip_DeleteSingleCusip", "ID")=20

Try=20
'Update the data source with the DataSet changes=20
SqlHelper.UpdateDataset(insertCommand, deleteCommand,=20
updateCommand, dsCusip, "Cusips")=20

MsgBox("Data Saved")=20
Catch ex As Exception=20
MsgBox(ex.Message)=20
Catch concurrencyException As DBConcurrencyException=20
MessageBox.Show("A concurrency error has ocurred while=20
trying to update the data source", "Application Error",=20
MessageBoxButtons.OK, MessageBoxIcon.Error)=20
ErrorMsg =3D "The following rows weren=B4t updated: "=20
Dim currentRow As DataRow=20
For Each currentRow In CusipTable.Rows=20
If currentRow.RowState <> DataRowState.Unchanged Then=20
ErrorMsg +=3D Environment.NewLine & "Product ID: " &=20
currentRow("ProductID").ToString() & _=20
" Product Name: " & currentRow("ProductName").ToString()=20
End If=20
MsgBox(ErrorMsg)=20
Next=20
Finally=20
'set the changed flag=20
iChange =3D 0=20
End Try=20
End Sub=20

Private Sub CreateReport(ByVal QueryType As String)=20
MsgBox(strConnection)=20
End Sub=20

Private Function GetConnection(ByVal connectionString As=20
String) As SqlClient.SqlConnection=20
Dim connection As New SqlClient.SqlConnection
(connectionString)=20

connection.Open()=20

Return connection=20
End Function=20


Private Sub Form1_Load(ByVal sender As Object, ByVal e As=20
System.EventArgs) Handles MyBase.Load=20
strConnection =3D ConfigurationSettings.AppSettings.Get
("ConnectionString")=20
End Sub=20
End Class=20
**********************************************************
****************

RE: Trying to Auto Deploy Windows App (No Luck!) by quansun

quansun
Sun Aug 03 20:04:58 CDT 2003

I'm now performing research on the issue. I will update you as soon as
possible.
Best regards,

Duke Sun
Microsoft Online Partner Support
<MCSE/MCDBA/MCSD>

Get Secure! ¨C www.microsoft.com/security
This posting is provided ¡°as is¡± with no warranties and confers no rights.


RE: Trying to Auto Deploy Windows App (No Luck!) by quansun

quansun
Tue Aug 05 08:44:10 CDT 2003

I'm still performing research on the issue. I will update you as soon as
possible.

Best regards,

Duke Sun
Microsoft Online Partner Support
<MCSE/MCDBA/MCSD>

Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


Re: Trying to Auto Deploy Windows App (No Luck!) by Ian

Ian
Wed Aug 06 08:23:10 CDT 2003

I did exactly what was given for instructions and I still receive the
following error

An unhandled exception of type 'System.Security.SecurityException' occurred
in IEExec.exe

Additional information: Request for the permission of type
System.Security.Permissions.SecurityPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.


"Duke Sun" <quansun@microsoft.com> wrote in message
news:i64K8ZBXDHA.2080@cpmsftngxa06.phx.gbl...
> You may try to get fulltrust permission to the assembly, as the following
> steps:
>
> 1. On the web server, open the Microsoft .NET Framework Configuration
> from Administrative Tools.
> 2. Expand Runtime Security Policy->Enterprise->Code Groups. Note that
you
> can choose Machine or User depending on the level of access required.
> 3. Right-Click on All_Code and select new.
> 4. Choose "Create a new code group", and give it a relevant name such as
> the name of the applications share then select Next.
> 5. On the next dialog choose URL from the drop-down list
> 6. In the URL dialog put the path to the share in this exact format
> "http://SERVER/Cusip/CusipWindows.exe"
> 7. Click Next, and on the next page choose "Use an existing permission
> set, and choose Fulltrust from the drop-down list.
> 8. Click Next and then Finish.
>
>
> Best regards,
>
> Duke Sun
> Microsoft Online Partner Support
> <MCSE/MCDBA/MCSD>
>
> Get Secure! ¨C www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
>



Re: Trying to Auto Deploy Windows App (No Luck!) by Ian

Ian
Wed Aug 06 13:44:15 CDT 2003

I figured out the problem.

thanks

"Ian" <idalton@dlbabson.com> wrote in message
news:umV$i3BXDHA.536@TK2MSFTNGP10.phx.gbl...
> I did exactly what was given for instructions and I still receive the
> following error
>
> An unhandled exception of type 'System.Security.SecurityException'
occurred
> in IEExec.exe
>
> Additional information: Request for the permission of type
> System.Security.Permissions.SecurityPermission, mscorlib,
> Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
failed.
>
>
> "Duke Sun" <quansun@microsoft.com> wrote in message
> news:i64K8ZBXDHA.2080@cpmsftngxa06.phx.gbl...
> > You may try to get fulltrust permission to the assembly, as the
following
> > steps:
> >
> > 1. On the web server, open the Microsoft .NET Framework Configuration
> > from Administrative Tools.
> > 2. Expand Runtime Security Policy->Enterprise->Code Groups. Note that
> you
> > can choose Machine or User depending on the level of access required.
> > 3. Right-Click on All_Code and select new.
> > 4. Choose "Create a new code group", and give it a relevant name such
as
> > the name of the applications share then select Next.
> > 5. On the next dialog choose URL from the drop-down list
> > 6. In the URL dialog put the path to the share in this exact format
> > "http://SERVER/Cusip/CusipWindows.exe"
> > 7. Click Next, and on the next page choose "Use an existing permission
> > set, and choose Fulltrust from the drop-down list.
> > 8. Click Next and then Finish.
> >
> >
> > Best regards,
> >
> > Duke Sun
> > Microsoft Online Partner Support
> > <MCSE/MCDBA/MCSD>
> >
> > Get Secure! ¨C www.microsoft.com/security
> > This posting is provided "as is" with no warranties and confers no
rights.
> >
>
>