|
I have created an application using asynchronous sockets that starts a local server, allows clients to connect to it. When the server starts, it creates an inherited version of my client class to create a connection to a unix server. There is no real difference in the connection, only the way data is handled when it comes back. When the server starts, the unix client creates a connection through to the remote point, sends a message and receives a response. This works fine. When my windows based client connects to the server, it sends a message on connect as well, the server receives this and then forwards a message to the unix client to tell it to forward a wakeup to the unix system. On receipt of the message back from unix acknowledging this, the server crashes with the following message.
System.InvalidOperationException was unhandled
Message="The Undo operation encountered a context that is different from what was applied in the corresponding Set operation. The possible cause is that a context was Set on the thread and not reverted(undone)."
Source="mscorlib"
StackTrace:
at System.Threading.SynchronizationContextSwitcher.Undo()
at System.Threading.ExecutionContextSwitcher.Undo()
at System.Threading.ExecutionContext.runFinallyCode(Object userData, Boolean exceptionThrown)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteBackoutCodeHelper(Object backoutCode, Object userData, Boolean exceptionThrown)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
There is no indication of whereabouts in the program this happens, and the only other references to this problem I can find (forums.microsoft.com/msdn) have either no solution, or the solution makes no sense within my application.
In my send method, I set a waiting state, and within that loop I have an event in which I have Application.DoEvents( ) (I found it hangs otherwise and won't output anything until things have finished) removing that doesn't fix things. And any interaction I am having with the GUI at all I have wrapped in invoke (i only output log data to a richtext box). I'm at a loss as to how to proceed with this problem, and I don't know what I can change to fix it!
Any help appreciated.
|
|
|
|
|
For the reference of anybody who is interested the solution lay in the following;
public void ConnectionServer_OnWaitEvent(object sender, EventArgs args)
{
Application.DoEvents( );
}
became;
public delegate void ApplicationWaitEvent( );
public void ConnectionServer_OnWaitEvent(object sender, EventArgs args)
{
this.Invoke( new ApplicationWaitEvent( ApplicationWait));
}
public void ApplicationWait( )
{
Application.DoEvents( );
}
Basically, I have a wait event in my send function that needs Application.DoEvents( ) to give it the chance to display replies properly. I had tried removing it but this didn't fix my problem, unless I compiled wrong and thought my fix had been applied. Anyway, the answer was to use a delegate and invoke it from within my form. Application now runs ok.
|
|
|
|
|
Hi Guys,
I had an idea to help my asp.net development. The idea was to write a windows form which emulated the "watch" window in Visual Studio so that i may look at the current state (or past state if they have been disposed of) of the object i created in the code behind... All without using the debugger, which i loathe..
I have written the object viewer, just need the app :s
Is this possible? If so where should i start looking? Remoting is my first guess but im unsure..
Many Thanks,
matt
|
|
|
|
|
hi guys, i m recently facing questions in interview about differences b/w the .net series releases that is how or where can i find comparison b/w the improvements and changes from .NET 1.0 to 1.1 to 2.0
|
|
|
|
|
The size of the answer to that question is proportional to the size of the .NET framework...HUGE!
There are many improvements to most aspects of the .NET framework between v1.1 and v2.0. What you should do is pick a sub-system (such as ASP.NET, or ADO.NET) and go check out on Microsoft's web site what they have to say about how 2.0 improves that sub-system. They have plenty of info about why you should upgrade to the latest and greatest, etc.
Josh
|
|
|
|
|
Hi there.
I read on MSDN that one can use a certificate associated with a party to encrypt messages to that party. But in the Certificate tab in the Party Properties dialog it says "Signature certificate" (indicating that the specified certificate will be used to sign messages, not to encrypt them). It would have been nice if this certificate overrides the one specified on the port. Am I missing something here?
*Is there a way to dynamically set an encryption certificate on a Send Port (not by programming to Biztalk Explorer OM) through an orchestration by passing parameters to a shape of some sort?
*Or do i have to create a new port for each Party, and on that port specify the encryption certificate for that specific Party?
The results should be like a dynamic send port that has a dynamic "address" AND replaceble/dynamic certificates. Is this possible?
|
|
|
|
|
Hi! Can someone with a good understanding of .NET security explain to me why assemblies on a network share gets the "Zone - Internet" classification? I thought network shares were supposed to be "LocalIntranet". Used to work before we reorganized our Windows domain.
This is the output I get from "caspol -resolvegroups test.exe":
Microsoft (R) .NET Framework CasPol 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
Level = Enterprise
Code Groups:
1. All code: FullTrust
Level = Machine
Code Groups:
1. All code: Nothing
1.3. Zone - Internet: Internet
Level = User
Code Groups:
1. All code: FullTrust
Success
Thanks.
/Per Erik Stendahl
|
|
|
|
|
Dear Experts
I have an Act.X in my source code,showing a map and without any routine for print it context.I guess I can print its context using Draw method and passing a printer device context to it.But I can't find any way to take a printer device context else using win32 API.Is there any way in .NET framework and managed code to do it?
Any help will be highly appreciated
Regards
Reza
|
|
|
|
|
Hello
I have created a solution wherein i hv used control components and added my code to it. The dll of these components were prepared and hv already been used in my solution and forms hv been created. But now i hv changed one of the components properties (the font) and thereby the dll has been changed.But now i want to update all the controls in all the forms. How can i solve this problem?
Please let me know....
Thanking You
Nithya
|
|
|
|
|
hv?
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
You dint mention whether it is an Web or windows application?
If this is a winform appllication, Just change the reference. Remove reference of the old dll and add referece to the new dll.
I suppose this should work for webapplicaiton as well..
|
|
|
|
|
Thnx for ur reply.
Yes it is a windows application.
The solution you suggested allows new controls that can be added in the new format. But the old ones that have been created does not change their font. My basic requirement is that all of them change their fonts. Working on it, but if you have any ideas pls mail.
Thanks
Nithya
|
|
|
|
|
Most probably the designer already generated the code for the Font property. Thus no matter what you change in the control the designer will overwrite it with its generated code. If you really want that all your control have a fixed Font which cannot be changed than you'll have to override the Font property in your control and leave the setter empty.
|
|
|
|
|
You might be dealing with two different versions of a dll.
Say, You create a windows custom control, add it to the toolbox using add/remove component and designed all your forms. And now, you have updated the custom control and a new dll will be created.
To solve this you have to find the path where you old dll resides and replace it with the new one and build the application.
*check* The refrence path to dll and one which is in the toolbox points to the same location.
|
|
|
|
|
Dear All,
I just tried to instal .NET framework 2.0 but why it can't integrate with MSVS 2003? Please answer me . . .?
Note : I already uninstalled .NET Framework 1.1 but still not working...
|
|
|
|
|
One obvious reason is .NET 2.0 bring complete new syntax that VS2003 can't support.
I think that MS might have an underground, unofficial and unsupported project to bring .NET 2.0 to VS2003.
But anyway, why not try the free Visual Express Edition[^]?
|
|
|
|
|
Simple...It'll never work. Visual Studio 2003 work ONLY with the .NET Framework 1.1. You cannot use VS2003 with the .NET Framework 2.0.
You can, however, install both .NET Frameworks 1.1 and 2.0 side-by-side, along with Visual Studio 2003 and 2005 side-by-side, and everything will work just fine.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I just download wikipedia's wikibooks dump file.
http://download.wikimedia.org/[^]
I have a hard time figuring out what to do with 130MB XML file.
I tried hard to convert it to to a MySQL database with xml2sql but grr... mysqlimport keeps failing with column id invalid...
How could I use the damn thing!
130MB of XML! Most of my text editor / viewer just fail...
|
|
|
|
|
Write an XSLT transforming it into whatver you want - or use an XmlReader... or load it into an XPathDocument. There are plenty of options, but as we have no clue whatsoever what you want to achieve with the data I do not see how we should be able to help you find the best way of dealing with it.
|
|
|
|
|
I want to reuse some data. But 1st I have to know the DTD and to find how to:
1. find the data I'm looking for.
2. reuse the books content.. I mean I don't know its format yet..
|
|
|
|
|
DTD is something they used in the dark ages, but I guess the schema will do as well.
If you can't find an editor that will deal with such a large file you can make a small program based on the XmlReader that will read the document. This program could dump each child of the root element to a separate file (or the first 10 children if you do not need thousands of files).
You might also be able to load it into an XmlDocument if your computer has enough memory.
Alternatively look in the source code generating the dump if it is available.
|
|
|
|
|
Ho.....
Yesterday I had a bug which made me though it would be horribly slow...
But in fact I could skip the 130Mb in a very reasonable amount of time (~ 2 second) with the XML text reader, cool!
I think I will write a small dynamic tree view, which loads node as I open them.
This way I could explore the whole XML document at my own pace!
|
|
|
|
|
Hello!
I have the following problem:
I am writing a plugin for another application where I have the source, too. This application was orignally programmed with VS .Net 2003. I converted the project file to VS .Net 2005, everything fine so far.
The forms in that application originally used the .Net Framework 1.1, because they were built with .Net 2003. The original exe and the exe from the converted project both show the form in old-style (not XP-style) UI.
My plugin was build with VS .Net 2005 from scratch. When I run it as a standalone application, the forms get the XP-Style layout. But when I run it as a plugin for the application, the forms look old-style.
Does anybody know why me code does now use the xp-style when I'm using as plugin? Are there any switches I have to activate in the project settings of the 3rd party application?
Thanks in advance,
Stefan Schwarzbach
|
|
|
|
|
You need to Enable visual styles in your EXE's code.
System.Windows.Forms.Application.EnableVisualStyles();
|
|
|
|
|
Hi Joshua,
thank you, it works perfectly!
Best regards,
Stefan
|
|
|
|