Sunny
6/16/2004 4:01:00 PM
Hi,
where exactly it crashes, and with what exception?
Put your writing code in try/catch block and try to investigate.
Sunny
In article <5f7b7cad.0406160652.76965e6f@posting.google.com>,
caughtfire@juno.com says...
> Hi all,
>
>
> I''m currently working a remoting server using IIS and Binary
> formatting. I use Global.aspx to configure the server. All of my
> business logic has trace logging built into it, and it''s causing
> problems. It wasn''t until I tried using a stripped down object (does
> nothing but return timestamp) that I was able to figure out where to
> problem was.
>
> It turns out that any attempt to open/write a file crashes that
> instance of the remote server. It is not a permissions issue...it''s
> only when I use remoting. If I add a WebForm to the server project,
> and run it, I get the page (complete with all logging calls) without
> any trouble.
>
> Does anyone know how to do this?
>
> Below is a sample of my Application_Start event from GLobal.ascx
>
> Thanks,
> Andy
>
> Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
> '' Fires when the application is started
>
> Dim oWriter As New IO.StreamWriter
> (System.AppDomain.CurrentDomain.BaseDirectory + "log.txt", True)
>
> With oWriter
> .WriteLine(Now.ToLongTimeString)
> .Flush()
> .Close()
> End With
>
>
> Dim props As New Hashtable
> props("name") = "MyChannel"
> ''props("priority") = "100"
> Dim srv As New BinaryServerFormatterSinkProvider
>
> ''CLog.WriteTrace("Register Channel")
> '' Nothing entries specify the default formatters.
> Dim channel As New HttpChannel( _
> props, _
> Nothing, _
> srv _
> )
> ChannelServices.RegisterChannel(channel)
>
> ''CLog.WriteTrace("Register Test Object")
> ''Test Object
> Dim WKSTE As New WellKnownServiceTypeEntry( _
> GetType(ServiceClass), _
> "SAService.rem", _
> WellKnownObjectMode.SingleCall)
>
> RemotingConfiguration.RegisterWellKnownServiceType(WKSTE)
> End Sub
>