|
Are you running multiple versions of .NET on your machine? It could be that the app is targetting a different version of the runtime to the one you think it is. A way to test this is to create a virtual machine with an installation of the framework that you think it's targetting, and attempt to run the application in this VM. Then, if it still fails, create a simple console application that definitely targets that version. If you the console app works, then you pretty much know that either your whole application is hosed, or it's a different version of the framework that it should be running.
One thing you could do, is try to load your assembly from a different .NET application using the Assembly load methods and see if it throws a BadImageFormatException which can occur if your application is either not a .NET assembly, or is internally corrupted.
Beyond that, the corruption could be because you are relying on a component that uses a different version of the .NET framework to the one you reloaded, and that framework is corrupt.
|
|
|
|
|
thank you for the valuable suggetions..
i'll check all the cases
No Defeat Is Final Until You Stop Trying!.......
|
|
|
|
|
Good luck. I hate exceptions like this.
|
|
|
|
|
I think Microsoft .Net files were screwed up. failed to use Control Panel to get rid of them. Able to download Microsoft .Net V2.0 for install, but just did a repair .
|
|
|
|
|
Could the subject be any more clear?
Especially when writing your own Generic classes.
I kind of know how they work (little experience).
For example, would the following be acceptable?
Public Interface ISomething(As T)
Function Something As T
End Interface
Public Class SomethingElse(As T)
Public Property SomeStuff As T
End Class
Or is that just not best practice?
I know some of the benefits, like no (un)boxing of Objects (thus fater performance and less chance on wrong casts?).
What are the drawbacks?
Edit:
And of course when to (not) use Generics
It's an OO world.
|
|
|
|
|
Generics can be very useful. I believe the complier actually creates the classes based on the type so you end up with multiple versions of the same class - one for each (or each combination of types if using <T, V> etc). This I suppose could lead to bloat if there are lots of different T s in your code, but there would have to be a lot! If you used object then there would only ever be one type of the class.
I'm not fond of auto properties as there is no oportunity for validation in the setter or event raising.
|
|
|
|
|
Not sure what you mean, but if you mean that the following...
Public Class Something(Of T1, T2)
Public Function GetSomething(ByVal var As T1) As T2
End Function
End Class
Public Class Form1
Private _field As Something(Of SomeClass, SomeOtherClass)
Sub Me_Load(...) Handles Me.Load
_field = New Something(Of SomeClass, SomeOtherClass)
Dim var As SomeOtherClass = _field.GetSomething(New SomeClass)
End Sub
End Class
...creates a couple of versions of SomeClass and SomeOtherClass I think you are wrong.
Actually I think the only instances of SomeClass and SomeOtherClass are the Class I pass to the Function and the Class that it returns (var ). And of course I have an instance of the Something(Of T1, T2) Class .
Correct me if I am wrong
When there is no need for validation or event raising a non-auto property creates a lot of overhead
It's an OO world.
|
|
|
|
|
Naerling wrote: couple of versions of SomeClass and SomeOtherClass I
think you are wrong
I will need to check (maybe over the weekend) but I'm sure I remember reading this on MSDN or somewhere similar.
Naerling wrote: When there is no need for validation or event raising a non-auto property
creates a lot of overhead
Not true, the backing field is created invisibly for you in the IL, these are identical to all intents and purposes (C#):
public T SomeData
{
get; set;
}
private T someData
public T SomeData
{
get { return someData; }
set {someData = value; }
}
|
|
|
|
|
With overhead I meant extra code to write and dirty your screen
Thanks for pointing it out though.
DaveyM69 wrote: but I'm sure I remember reading this on MSDN or somewhere similar
I would like to read that too
It's an OO world.
|
|
|
|
|
|
Thanks for the link. It shows even code gets instantiated!
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Thanks for the link!
I think I misunderstood your earlier post after reading this.
And it never actually occured to me that value and reference types would work differently (well Rob already explained it pretty well too).
This article clears some things up though.
It's an OO world.
|
|
|
|
|
If I recall correctly, the behaviour is as follows:
When the run-time loads a generic class, it does create multiple versions, but not as many as you may think.
Consider...
Public Class Pair(Of T1, T2) ' I detest the generic syntax for VB, C#'s <T1, T2> is so much clearer
Public First As T1
Public Second As T2
End Class
For T1, the compiler must generate a version of each value type (derived from System.Value, such as Int16, Int32, ...) because the representation of the object varies - some value types may be larger than the size of an object reference.
However, where T1 is an Object type, the variation can be omitted, as the representation remains constant.
Similarly for T2.
So for Pair(int, char) is one type, Pair(int, Person) is one, but Pair(int, object) can share the representation of Pair(int, Person). Obviously Pair(object, int) is another axis of variation, but there tend to be reasonable bounds to the amount that occur in practise.
|
|
|
|
|
I am trying to retrieve a value within a textbox that has a vlue already passed to it within a webpage. As you can see I am trying to extract the last name here(red fire truck:
<span id="CallerForm1_CallerInformation1_lblLNameLabel" class="clsFormLabelSide" style="font-size:XX-Small;z-index: 109; left: 273px; position: absolute;
top: 56px">(last)</span>
<input name="CallerForm1:CallerInformation1:txtLName" type="text" value="RedFireTruck" maxlength="50" id="CallerForm1_CallerInformation1_txtLName" style="width:168px;z-index: 105; left: 266px; position: absolute;
top: 72px" />
What I have been using is the chunk within the methos: Document Completed. Im trying to store its value in a variable so I can pass the var to the next screen or a different page. All I could come up with was this. keep in mind I am using a msgbox to see if anything has been saved or retrieved by so far I havent gotten any notifications:
Dim theElementCollection As HtmlElementCollection = wbCHCTrac.Document.GetElementsByTagName("input")
If wbCHCTrac.Url.ToString.Contains("client/upd_caller.aspx?") Then
For Each currentElement As HtmlElement In theElementCollection
Dim controlName As String = currentElement.GetAttribute("id").ToString
If controlName = "CallerForm1:CallerInformation1:txtLName" Then
MsgBox(currentElement.GetAttribute("Value").ToString)
End If
Next
End If
Any help would be appreciated =)
|
|
|
|
|
I am probably stating the obvious, but I presume you have at some stage determined whether the DocumentCompleted handler is ven getting fired, and if so whether execution is ever going within the first If statement?
And am I missing something.. your html has ...
id="CallerForm1_CallerInformation1_txtLName"
but then you're looking for an id ""CallerForm1:CallerInformation1:txtLName" (colon, not underscore)
Dim controlName As String = currentElement.GetAttribute("id").ToString
If controlName = "CallerForm1:CallerInformation1:txtLName" Then
Shouldn't that be..
Dim controlName As String = currentElement.GetAttribute("id").ToString
If controlName = "CallerForm1_CallerInformation1_txtLName" Then
|
|
|
|
|
Hi,
We are releasing a complete project development SDK for everyone. This SDK is being used commercialy in my
company for more than 6 years, so it is stable. We solved a big problem for consulting companies -
integrate everything and automate everything, including : code subversion (proprietary), tasks/bugs, project
management (branching the whole solution with one click), data access (proprietary), generating a install version,
having multiple web sites, interfaces... code reuse with modules export/import... a lot of features.
Here is the site with information / downloads / samples and forums:
http://sycraf.com/default.aspx
The main goal of this release is that people can create open software with this platform - you can export and
import any project done with the SDK... similar with source forge, but more .NET oriented.
If you need any online help, use the skype button in the support page.
Thanks for reading.
-Rod
|
|
|
|
|
Not the place for advertising.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
This is not an add, its a free tool.
|
|
|
|
|
Doesn't matter, this forum is for people to ask questions, and receive answers, about issues involving .NET Framework. You have neither asked a question nor provided an answer to one. Instead, you have posted an advertisement, regardless if the tool is free or not. You have been a member here for over five years and this is the first thing you choose to post?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I agree with Mark, if you want to promote your software then post an article about it, and let people decide for themselves on its value.
I must get a clever new signature for 2011.
|
|
|
|
|
Ok, i will write an article about the tool.
|
|
|
|
|
Sounds dreadful.
|
|
|
|
|
How do I transfer file (SSH) in vb.net (VS 2005)?
|
|
|
|
|
Your question is pretty vague, but maybe this article[^] will get you started. The project is now hosted on sourceforge[^]. Also, there is sharpssh2[^].
As far as VB.net goes, you can just add a reference to SharpSSH and call the code from your VB app. Further, there isn't any native support for SSH in .net AFAIK. I hope this helps.
|
|
|
|
|
This is my first post here so Hi everyone!, in the beginning i want to say sorry for my bad English (this isn't my mother tongue).
So i have problem when using wrapper (EMGU) for openCV CvExtractMSER method, i cannot receive any result from it.
Here is an example of code that i used:
Image<Gray, byte> img = new Image<Bgr, byte>(filePath).Convert<Gray,Byte>();
Emgu.CV.Features2D.MSERDetector param = new Emgu.CV.Features2D.MSERDetector(1, 10, 100, 0.05f, 0.2f, 200, 1.01, 0.03, 3);
MemStorage storage = new MemStorage();
Image<Gray, Byte> mask = new Image<Gray, Byte>(img.Width, img.Height, new Gray(1));
Seq<Point>[] regions= img.ExtractMSER(mask, ref param, storage);
regions length is always zero (is empty)..
I tested before MSER parameters and testimage in C implementation https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/c/mser_sample.cpp?rev=2633 and everything works fine, here not, why?
I can mention that I measured execution time of line
Seq<Point>[] regions= img.ExtractMSER(mask, ref param, storage);
and it's around 40ms (similar to C implementation) so something is calculated inside method..;)
Thanks in advance..
|
|
|
|
|