|
I'm pulling my hair out over this one.
If I run all the tests in my solution 13 fail.
When my automated build runs on the build server all of the tests pass.
If I run one of the failed tests by right clicking inside the test (Visual Studio 2010) and clicking "Runs Tests" it fails.
If I run the same test using the little circle in the left gutter from ReSharper it passes.
This leads me to believe it has something to do with the Host type? But I am not sure.
The failure in the test has to do with a Method Not Found exception. The class under test, ClassA, inherits from ClassB (from a referenced assembly). Class B has a method on it that is being called in the code, and when the tests fail they do so because the method cannot be found.
Does anyone have any ideas about what might be causing this or how I can fix it?
EDIT: As it turns out MSTest is not copying the right version of my assembly to the Out folder, which would make sense why it can't find the method. The correct version is referenced in the Test project, not sure why it is hanging on to the old version, or where it's getting it from.
modified 18-Jan-13 11:44am.
|
|
|
|
|
Solution
I cheated a little. I didn't want to waste the time figuring out where my DLL was being cached. Using Windows Explorer I searched my solution folder and all subfolders for the assembly, changed the results to Details view and added File Version to the result columns.
I deleted all of the old versions of the files and re-ran the tests and now they pass.
Stupid %$!&!@(! MS Test.
|
|
|
|
|
Hi, in what book or an special website can I find useful, extensive and almost complete resources about the under the hood of .NET framework like CLR, DLR and so on?
|
|
|
|
|
MSDN, this book[^] are good places to start. The framework is so big, though, that you will never get complete information - you will just never need to use it all.
|
|
|
|
|
Thanks a lot. You mentioned that book to start but can you please name all the books you know about that maybe related to this subject I need?
|
|
|
|
|
Dear lord no. This is a huge area and it would take you 100s of books and 10s of 1000s of hours to master ALL of the insides of the framework, and by that time it will have grown again.
|
|
|
|
|
Not for advertisement, but take a look to the book "CLR via C#" by J. Richter. It's a nicely describe CLR and programming for CLR.
|
|
|
|
|
Yeah, I'm familiar with that name. I like to find more topics about that deepness in .NET.
|
|
|
|
|
Honestly the best way to learn how a runtime works is to learn how to debug it at the lowest levels. Read every single article here: Tess Ferrandez on MSDN[^]. Read if from start to end (well, actually end to start) and you should have really good in-depth knowledge (granted, reading and digesting that whole blog will probably take a few months). Real-world experience/stories sticks a lot better than raw theory (at least in my experience).
He who asks a question is a fool for five minutes. He who does not ask a question remains a fool forever. [Chinese Proverb]
Jonathan C Dickinson (C# Software Engineer)
|
|
|
|
|
That blog is so useful. Thank you so much.
|
|
|
|
|
CLR via C# by J. Richter (though already mentioned above) would be my answer to a book.
There are some very good reads on msdn which go down in details of the framework.
Selective reading on http://www.wintellect.com/[^] will be useful for going in deep into the framework.
|
|
|
|
|
Perhaps you could download the source code of .Net framework and look into it:
http://referencesource.microsoft.com/netframework.aspx[^]
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore, Dream. Discover.
|
|
|
|
|
.NET is a layer on top of the WinAPI.
Learn that.
(WinAPI is a layer on top of HAL.DLL - you don't want to learn that)
|
|
|
|
|
can anyone help explain what might happen to a .NET application if file system crash? Simply put, should the apps pop up warning/error reminding that file system is carshed? How does your apps deal with file system crash?
Please help answer, many thanks.....
|
|
|
|
|
What do you mean by "file system crash", and how do you think the app could recognise it?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
for example, a designated folder got changed, not able to write into it, the system shall pop up error message, right? so I have to make specific error exception/message for this kind of case, otherwise the system just gave general error message, am I right?
|
|
|
|
|
You would need to implement FileSystemWatcher, take a look at these links[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
As the inability to save to a certain location is a predictable exception (e.g. the user attempts to save into the Windows folder on Windows 7 when running with normal permissions), it's always a good idea to protect against this type of exception.
|
|
|
|
|
alexyxj wrote: can anyone help explain what might happen to a .NET application if file system
crash?
In general - no.
alexyxj wrote: How does your apps deal with file system crash?
Whatever the business requirements suggest and reasonable extrapolation from that.
For example I don't try to do anything at all about the file system filling up for a server. Can it happen? Yes. If it does what can I do? Nothing. I do however expect that any reasonable operations setup would take into account file system monitoring.
As another example if I can't read a configuration file that the server requires on start up then besides logging an error I can do one of the following
- Start with default values.
- Exit the server.
The choice depends on what was supposed to be in the configuration file that I was reading.
(Note that a logging solution MUST be implemented such that a logging failure does not stop the application from running.)
A stand alone user application should probably do something different. If it cannot read/write to the fle system then it should report that to the user.
|
|
|
|
|
Thanks Richard/Pete/jschell, you guys provided very helpful knowledge, appreciate!
|
|
|
|
|
|
I do I get description from Public Enum?
Public Enum API
'''
''' Using Google API
'''
<description("google api")=""> Google
'''
''' Using Yahoo API
'''
<description("yahoo api")=""> Yahoo
End Enum
API.Yahoo.Description not working
|
|
|
|
|
what programming language your are using and how you are trying to access the description?
Jibesh V P
|
|
|
|
|
You need Reflection . With that, you can retrieve the DescriptionAttribute .
Look at some articles on Enum Description Converters, e.g. Description Enum TypeConverter[^].
|
|
|
|
|
Those are XML-comments, and comments aren't compiled into the code. You could use a DescriptionAttribute as already mentioned, or you'd manually parse the generated XML.
|
|
|
|