Re: Peer Network vs. Domain

From: Sunny (sunny_at_newsgroups.nospam)
Date: 07/20/04


Date: Tue, 20 Jul 2004 15:02:20 -0500

Hi,

and the exception is ...?

Sunny

In article <u3RJo3obEHA.796@TK2MSFTNGP09.phx.gbl>, "Howard Swope"
<howardsusenetATspitzincDOTcom> says...
> I am building an app that uses .Net remoting. My development machine is on
> the company domain, but the environment in which it will be deployed is a
> peer network. I test the app on any machine withing the domain and it works
> fine. Testing on any machine on the peer network throws an unhandled
> exception.
>
> I let only one instance of the application run. If someone fires a second
> instance off, I detect the first running instance and then use .Net remoting
> to pass the command line arguments from the newly run app to the already
> running app. The first instance will run fine on the peer network, but the
> second instance throws the unhandled exception. You can see the second
> instance specific code begin at [if (!granted)]. Any thoughts?
>
> static void Main(string[] args)
>
> {
>
> // turn off com security
>
> System.Threading.Thread.CurrentThread.ApartmentState =
> System.Threading.ApartmentState.STA;
>
> int ret = CoInitializeSecurity(IntPtr.Zero, -1, IntPtr.Zero,
> IntPtr.Zero, 1, 3, IntPtr.Zero, 0, IntPtr.Zero);
>
>
>
> // check to see if this is the first instance
>
> bool granted;
>
> Thread.CurrentThread.Priority = ThreadPriority.AboveNormal;
>
> Mutex firstInstanceMutex = new Mutex(true,"FirstControlPanelMutex",out
> granted);
>
> if (!granted)
>
> {
>
> Thread.CurrentThread.Priority = ThreadPriority.Normal;
>
> if (args.Length == 0)
>
> return;
>
>
>
> ChannelServices.RegisterChannel(new TcpChannel());
>
> SPControlPanel thePanel =
>
> (SPControlPanel)Activator.GetObject(typeof(SPControlPanel),"tcp://127.0.0.1:
> 8229/SPControlPanel");
>
> thePanel.AddToPlayList(args);
>
> return;
>
> }
>
>
>
> // Register channel services for remoting and the two root classes
>
> TcpServerChannel tsc = new TcpServerChannel(8229);
>
> ChannelServices.RegisterChannel(tsc);
>
>
> RemotingConfiguration.RegisterWellKnownServiceType(typeof(SPControlPanel),"S
> PControlPanel",WellKnownObjectMode.Singleton);
>
>
>
>
>
> //#if !DEBUG
>
> ExceptionHandler eh = new ExceptionHandler();
>
> Application.ThreadException += new
> ThreadExceptionEventHandler(eh.OnThreadException);
>
> //#endif
>
>
>
> Resources = new ResourceManager(typeof(SPControlPanel));
>
> MainWnd = new MainWindow();
>
> Monitor.Enter(MainWnd);
>
> MainWnd.AddPlayListItemsFromCommandLine(args);
>
> Application.Run(MainWnd);
>
> }
>
>
>
>
>



Relevant Pages

  • Re: Application xxx has encountered a serious error and must shut
    ... Chris Tacke, Embedded MVP ... use of Queueacross multiple threads - and even my exception ... stopped my Serial port thread - last time it stopped the whole app:-O. ... NB I replaced the MS SerialPort with OpenNetCF Serial and this seems ...
    (microsoft.public.windowsce.app.development)
  • Re: Exception management question...
    ... There is code in my app that follows this general pattern: ... This allows an exception to be thrown with the next line of code attempts to ... >> to propagate up to a global exception handler which logs the exception ... > has determined that the app should terminate the UE handler has no means ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SqlceException.SqlceException
    ... First of all, i found the cause of the exception and corrected it, it was ... > same challenge in terms of deploying the initial SQL CE database. ... > db along with your app. ... it is the first time i am doing mobile applications and the first ...
    (microsoft.public.sqlserver.ce)
  • Re: wtf?
    ... > called by the ASP classic app, ... >> other than error translation. ... > exception that comes from the command's execute method doesn't seem to ... > the time we might be content saying "SqlException", in this case, we ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: strong key problems
    ... it is not clear what you are actually trying to accomplish by somehow ... i - how to create a strong key and use it in your applications. ... iv - any referencer to any app with strong name must also have a strong ... Unhandled Exception: System.Security.SecurityException: That assembly ...
    (microsoft.public.dotnet.languages.csharp)