|
I am facing a problem when using VSTS with NUnit 2.2.6.
I am testing a website. After opening the browser it closes immidiately and
I am getting the following error.
!!!SCENARIO FAILURE!!!
Info: Failed to execute test cases due to run time error: ‘The HWnd is no longer valid’
Image: file:///C:\Program%20Files\NUnit-Net-2.0%202.2.6\bin\MAUI_Chrome%20MastHead%20section-Scen10.jpg
Is the problem with NUnit 2.2.6? Let me know.
Thanks in advance
Deeps..
|
|
|
|
|
how can I transfer a file using TCP packet by packet (regardlless the packet size)?
how can I transfer a file using UDP packet by packet (regardlless the packet size)? or on another mean
how can I do the folloing:
J.U.S.T
|
|
|
|
|
You need to use some other protocol - it can, if you insist, be one you design yourself - on top of TCP because TCP does not preserve message boundaries, so you need to tell the receiver how much data to expect, or look for some terminator.
For example, HTTP terminates the headers with a blank line (the sequence CR-LF-CR-LF) and either uses the Content-Length header to indicate how much data is present, or closes the connection once all data has been transmitted (IIRC). FTP uses a separate connection for data transfer, the end of the data being signalled by closing the connection.
UDP preserves message boundaries but is not reliable - you have no way to know whether a particular packet has arrived unless you code the receiver to send acknowledgements. You often find that you end up reinventing about 90% of TCP if you try to come up with a multi-block data-transfer scheme. You should not send more data in one message than the network can actually fit into an IP packet (the Maximum Transmission Unit), because otherwise the datagram will be fragmented, which has a massively detrimental effect on datagram loss. Say that packet loss in the route to the receiver is 5%. The chances of a datagram that fits into a single packet arriving is 95%. The chances of a datagram that must be split into two packets (fragments) arriving successfully is 95% x 95% = 90.25%, so you now get nearly 10% packet loss. The problem gets worse the more fragments you have.
Unfortunately different networks have different MTU sizes. TCP has a feature called Path MTU Discovery which allows it to work out how much data it can send in one packet without causing fragmentation. This feature relies on Internet Control Message Protocol (ICMP) responses from routers when asked to process a packet too big for the network it would be sent on. These messages will not be passed on to your application by the TCP/IP stack, so you cannot reimplement this feature in your own UDP-based protocol.
Stick to using UDP for single request/response pairs that will fit in a single packet, and use TCP for everything else. For file transfers I'd definitely use TCP.
For more information on the protocols, see the Winsock Programmer's FAQ[^]. This is oriented more towards native, rather than managed, programming, but should still be useful.
The .NET Framework contains a canned implementation of the HTTP protocol - see the HttpWebRequest class. .NET 2.0 has an implementation of FTP: FtpWebRequest . If you want to implement your own TCP-based protocol, see TcpListener for the server end and TcpClient for the client end. For UDP, see UdpClient . If you want to program the sockets directly, there's also the Socket class.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
I make a Setup Project in Visual Studio 2005 for my application. All works well but when I’m going to distribute an update in a new builded version of my application my clients have to first uninstall my application and then reinstall the new one.
I get the following error when I try to install my app again:
Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel.
How do I do to make the new release be installed over the old one?
_____________________________
...and justice for all
APe
|
|
|
|
|
There are 2 possible answers here....
1. You didnt set the new uninstaller to uninstall the previous version before the new install.
2. You made a completely different installer that has a new product code, which can not uninstall the other version (directly). Installers (even for the same program) with a different product code can not uninstall another version with a different product code.
Solutions:
1. Set UninstallPreviousVersion to true, redistribute.
2. You will have to create a custom action script to find and uninstall the older version with a different product code. You can find it in the registry (Hikey/Local Machine/Microsoft/Windows/CurrentVersion/Uninstall) by the old product code. You will need to run the uninstall string as a process. A note with this is that you cant have 2 instances of windows installer running at once, so you will need to create a custom action script to run on install that will fire the uninstaller program. The uninstaller should wait for the installer to exit before attempting to windows installer will not run to uninstall the program.
HTH.
Aaron
|
|
|
|
|
Aaron Dilliard wrote: Set UninstallPreviousVersion to true, redistribute.
Just perfect!! Thanks!!
_____________________________
...and justice for all
APe
|
|
|
|
|
hi guys !
need some help again..
i m developing an asp.net applictaion in c# in which i download lots of mail form a mailbox.. there is a for loop working in the code which checks the mails present in mailbox..
after downloading mail all the data (header,body,message) etc is saved in Mysql server..
the code is working fine .. but in some cases it gives the error "can't Connect to Mysql 10048" and crashes the application i have checked all the connection objects and related things but could'nt found the reason..
is the problem of application or problem of Mysql ... coundnt resolve
can any one help me...
Abhinav
|
|
|
|
|
Please Post it in MySql Discussion Forums
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshers
http://himabinduvejella.blogspot.com
|
|
|
|
|
Windows error code 10048 is a Windows Sockets error code, WSAEADDRINUSE . This error means that the IP address/port combination selected is already in use. Normally, client code does not explicitly select a port, so this would indicate that the number of dynamic ports available has been exhausted. This, in turn, would suggest that connections are being leaked, either by your web site or some other application.
Assuming that the MySql data provider follows the pattern of the Microsoft-supplied providers, I would ensure that you call Dispose on your connection objects when you've finished with them. To make this happen automatically, use a using block; the compiler will generate a call to Dispose at the end of the block for you. You should also call Dispose on any other objects that have a Dispose method, or implement the IDisposable interface, when you've finished using them. The SQL Server Data Provider classes SqlCommand , SqlTransaction and SqlDataReader also implement IDisposable ; you may find that the MySql equivalents also do.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
hi, i have a program which i always try to execute it in another windows.
that win has not crystall report,i affect with an error : "windows could not find many file such as crystall engin and etc", i have added this files but for a file as call as keycodev2.dll windows show a message : (file is invalid).
what is the matter? i copy it from visual studio cd why it is invalid?
|
|
|
|
|
Possibilities:
You don't have crystal installed in your system.
if it is installed then you have to add refrences of crystal program in your application.
Go to 'project'->refrences->com
First select Crystal Reports Library
if the programs runs succesfully. Then do your work. Other wise add all crystal refrences in the refrences dialog box.
|
|
|
|
|
I’m about to start a new project on an application that fore sure will be under development for about 3-4 years. I will start with an C# 2.0 WinApplication and I will try to make it pligin-based so I easy can meet my customer needs with new plugins.
I won’t go in detail on what my program should do but my problem is how can I make an application an then develop plug-ins for that application. My solution will bee 100% .NET based…
All tips on how to do plug-in-based development are welcomed!!
_____________________________
...and justice for all
APe
|
|
|
|
|
read up on System.Reflection . This namespace contains a lot of stuff which allows you to interogate, and dynamically load assemblies, and dynamically instantiate objects from those assemblies.
Your plugins should be custom class(es) which implement interfaces that you know about. You can then use reflection to instantiate your new plugged in objects, and you can call their functionality through interfaces. Design your interfaces carefully, you can't change them easily in the future.
using System.Beer;
|
|
|
|
|
Thanks. Looks like a good start for me!!
_____________________________
...and justice for all
APe
|
|
|
|
|
I have a dll file written by C++ MFC. I want to use it in C#, but I can't know how to use it. Who can show me how to use it?
Thanks a lot!
|
|
|
|
|
using System.InteropServices;
[dllImport("yourDll")]
public static extern type function(params);
Aaron
|
|
|
|
|
Hi,
I'm writing an application in c#.net and i'm completely new to it.
Please refer to the following code in which i'm getting an exception...
//.....................................................................
String classStartTime;
conn.Open();
String myQuery = "Select starttime from tblecture";
OdbcCommand myCommand = new System.Data.Odbc.OdbcCommand(myQuery, conn);
OdbcDataReader dataReader = myCommand.ExecuteReader();
try
{
while (dataReader.Read()) //exception
classStartTime = dataReader.GetTime(0).ToString();
}
finally
{
dataReader.Close();
conn.Close();
}
//.....................................................................
I'm getting this exception for only column named "starttime"; for other fields this code works fine.
Is there any other way to read a field of type time from database?
Thanks,
Kranti
-- modified at 4:13 Wednesday 19th April, 2006
|
|
|
|
|
There is a very obvious mistake that you are making here. The query myQuery is returning you only one column per row. You are using dataReader.GetTime(1) , which is trying to get the second column (indexes are zero based, not 1 based) and hence generating an index out of range exception, because there is nothing at the "1" ordinal.
Solution:
Change the line
classStartTime = dataReader.GetTime(1).ToString();
to
classStartTime = dataReader.GetTime(0).ToString();
|
|
|
|
|
In addition to the above, if your variable "classStartTime" is of type DateTime (as it should be) then you do not need the .ToString() call - it will cause an invalid cast exception.
if classStartTime is a string:
classStartTime = dataReader.GetString(0);
if classStartTime is DateTime:
classStartTime = dataReader.GetTime(0);
|
|
|
|
|
The first field has index 0, not 1.
---
b { font-weight: normal; }
|
|
|
|
|
even when i make it as ...
//...................................................
while (dataReader.Read()) //exception
classStartTime = dataReader.GetTime(0).ToString();
//...................................................
it generates the exception at the previous line i.e. the line containing "while", before going for this statement
Thanks,
Kranti
|
|
|
|
|
What is the exception generated?
|
|
|
|
|
the exception generated is "Array index out of bounds"
|
|
|
|
|
Array Index out of bounds was when you were trying to read element 1, that exception is unlikely to be being generated by the call to while(reader.Read()).
try posting the complete code, that is the relevant bit that is opening connection, creating command etc.
|
|
|
|
|
the complete code is as follows ...
//..................................
String connectionString = "Dsn=pgTEducation;database=teducation;server=192.168.0.135;port=5432;uid=divinet;readonly=0;protocol=6.4;fakeoidindex=0;showoidcolumn=0;rowversioning=0;showsystemtables=0;fetch=100;socket=4096;unknownsizes=0;maxvarcharsize=254;maxlongvarcharsize=8190;debug=0;commlog=0;optimizer=1;ksqo=1;usedeclarefetch=0;textaslongvarchar=1;unknownsaslongvarchar=0;boolsaschar=1;parse=0;cancelasfreestmt=0;extrasystableprefixes=dd_;lfconversion=1;updatablecursors=1;disallowpremature=0;trueisminus1=0;bi=0;byteaaslongvarbinary=0;useserversideprepare=0";
OdbcConnection conn = new System.Data.Odbc.OdbcConnection(connectionString);
String classStartTime;
conn.Open();
String myQuery = "Select starttime from tblecture";
OdbcCommand myCommand = new System.Data.Odbc.OdbcCommand(myQuery, conn);
OdbcDataReader dataReader = myCommand.ExecuteReader();
try
{
while (dataReader.Read())
classStartTime = dataReader.GetTime(0).ToString();
}
finally
{
dataReader.Close();
conn.Close();
}
//..................................
thanks,
Kranti
|
|
|
|