[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Logging to file on remoting server via IIS

caughtfire

6/16/2004 2:52:00 PM

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
4 Answers

Sunny

6/16/2004 4:01:00 PM

0

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
>

I Own The Letter O

2/26/2008 4:54:00 PM

0

On 23 Feb, 07:54, g...@mail.ru (Timofei Shatrov) wrote:
> On Fri, 22 Feb 2008 05:18:50 -0800 (PST), I Own The Letter O
> <lord_h...@yahoo.co.uk> tried to confuse everyone with this message:
>
> >Therefore to speed me through the early stages (the '@' moving around,
> >dungeon generation including solid walls & opening/closing doors,
> >basic monsters etc) I have decided to produce a 7DRL called @man
> >(pronounced Atman).
>
> LOL, is anyone actually going to create 7drl during the period which
> was voted on?
>
> --
> |Don't believe this - you're not worthless              ,gr---------.ru
> |It's us against millions and we can't take them all... |  ue     il   |
> |But we can take them on!                               |     @ma      |
> |                       (A Wilhelm Scream - The Rip)    |______________|

Argh! Newbie error! My compiler has been playing stupid b*gg*rs
anyway. First it wouldn't produce a correct console app on my laptop.
I gave up and reinstalled it on my PC. Several installations and
uninstallations later it produces a correct console app ("Hello World"
- snarf). I finally manage to recreate a funky little @man to walk
around the screen. I proudly add a splash screen at the start (stating
@man Alpha 0.0.1 to mark the momentous occasion) then all hell breaks
loose. A raft of errors come up, first in ostream (which I haven't
touched), then something like fbufstream!?! (which I definately
haven't touched).

I'll try and find out when the 7DRL begins this year and hopefully fix
my compiler by then. I'm currently using Borland C++ Builder 6, but
have an old copy of Visual Suite with Visual C++ knocking around
somewhere and gcc as well, may try those instead (but where would I be
without <conio>.

Note to self: when newbie check your equipment works thoroughly before
making introductionary promises.

Corremn

2/28/2008 12:08:00 AM

0

On Feb 27, 2:53 am, I Own The Letter O <lord_h...@yahoo.co.uk> wrote:
> On 23 Feb, 07:54, g...@mail.ru (Timofei Shatrov) wrote:
>
>
>
>
>
> > On Fri, 22 Feb 2008 05:18:50 -0800 (PST), I Own The Letter O
> > <lord_h...@yahoo.co.uk> tried to confuse everyone with this message:
>
> > >Therefore to speed me through the early stages (the '@' moving around,
> > >dungeon generation including solid walls & opening/closing doors,
> > >basic monsters etc) I have decided to produce a 7DRL called @man
> > >(pronounced Atman).
>
> > LOL, is anyone actually going to create 7drl during the period which
> > was voted on?
>
> > --
> > |Don't believe this - you're not worthless              ,gr---------.ru
> > |It's us against millions and we can't take them all... |  ue     il   |
> > |But we can take them on!                               |     @ma      |
> > |                       (A Wilhelm Scream - The Rip)    |______________|
>
> Argh! Newbie error! My compiler has been playing stupid b*gg*rs
> anyway. First it wouldn't produce a correct console app on my laptop.
> I gave up and reinstalled it on my PC. Several installations and
> uninstallations later it produces a correct console app ("Hello World"
> - snarf). I finally manage to recreate a funky little @man to walk
> around the screen. I proudly add a splash screen at the start (stating
> @man Alpha 0.0.1 to mark the momentous occasion) then all hell breaks
> loose. A raft of errors come up, first in ostream (which I haven't
> touched), then something like fbufstream!?! (which I definately
> haven't touched).
>
> I'll try and find out when the 7DRL begins this year and hopefully fix
> my compiler by then. I'm currently using Borland C++ Builder 6, but
> have an old copy of Visual Suite with Visual C++ knocking around
> somewhere and gcc as well, may try those instead (but where would I be
> without <conio>.
>
> Note to self: when newbie check your equipment works thoroughly before
> making introductionary promises.- Hide quoted text -
>
> - Show quoted text -

Visual C++ 2005 Express is a free download (but big) and is a full
feature compiler and perfect for RL development. I also have a
version of 2008 beta which is also free.

I Own The Letter O

2/28/2008 12:15:00 PM

0

On 28 Feb, 00:07, Corremn <corr...@dodo.com.au> wrote:
>
> Visual C++ 2005 Express is a free download (but big) and is a full
> feature compiler and perfect for RL development.  I also have a
> version of 2008 beta which is also free.- Hide quoted text -
>
> - Show quoted text -

I shall have a look at that over the weekend. My Borland does work
eventually, although everytime you compile (which I do very often,
almsot after every single tweak) you have to fiddle about with an i/o
library that it says is busted (and its a different point of the
library each time). Sometimes you delete a bit of whitespace and it
goes fine, others times it keeps generating that error until I close
Borland entirely and re-open the project. BIG PILE OF POOP! I'll also
have a look at my old Visual Suite and check out the internet for
<windows> versions of <conio> commands.

Thanks for the info.