Click here to Skip to main content
15,918,330 members
Home / Discussions / C#
   

C#

 
QuestionWhy does this string not work? Pin
KaKa'26-Mar-06 3:55
KaKa'26-Mar-06 3:55 
AnswerRe: Why does this string not work? Pin
Guffa26-Mar-06 4:23
Guffa26-Mar-06 4:23 
GeneralRe: Why does this string not work? Pin
KaKa'26-Mar-06 13:31
KaKa'26-Mar-06 13:31 
GeneralRe: Why does this string not work? Pin
Christian Graus26-Mar-06 13:45
protectorChristian Graus26-Mar-06 13:45 
AnswerRe: Why does this string not work? Pin
Guffa27-Mar-06 0:11
Guffa27-Mar-06 0:11 
QuestionRunning Sql Script From C#? Pin
majidbhutta26-Mar-06 3:43
majidbhutta26-Mar-06 3:43 
AnswerRe: Running Sql Script From C#? Pin
Colin Angus Mackay26-Mar-06 3:53
Colin Angus Mackay26-Mar-06 3:53 
QuestionAn attempt was made to load a program with an incorrect format Pin
Colin Angus Mackay26-Mar-06 2:05
Colin Angus Mackay26-Mar-06 2:05 
I'm using NUnit to test my application but it is giving me odd error messages that I have not seen before. I'm at a loss to think what configuration change I have made that would break NUnit. (Or what configuration changes I made at all) The application is new, so these are new unit tests fixtures. I also upgraded to NUnit 2.2.7 in case there was a problem with the previous version (no luck). My application runs okay if I launch it, yet I cannot test it.

Here is the message produced by using the NUnit console through TestDriven.NET:
------ Test started: Assembly: NOsm.Dao.Testing.dll ------<br />
<br />
TestCase 'M:NOsm.Dao.Testing.BookmarkDaoTest.SimpleTest'<br />
failed: Could not load file or assembly 'NOsm.Dao.Testing' or one of its dependencies. An attempt was made to load a program with an incorrect format.<br />
	System.BadImageFormatException: Could not load file or assembly 'NOsm.Dao.Testing' or one of its dependencies. An attempt was made to load a program with an incorrect format.<br />
	File name: 'NOsm.Dao.Testing'<br />
	at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)<br />
	at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)<br />
	at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)<br />
	at System.Reflection.Assembly.Load(String assemblyString)<br />
	at TestDriven.TestRunner.AdaptorTestRunner.Run(ITestListener testListener, ITraceListener traceListener, String assemblyPath, String testPath)<br />
	at TestDriven.TestRunner.ThreadTestRunner.Runner.Run()<br />
	<br />
	WRN: Assembly binding logging is turned OFF.<br />
	To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.<br />
	Note: There is some performance penalty associated with assembly bind failure logging.<br />
	To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].<br />
<br />
<br />
<br />
0 passed, 1 failed, 0 skipped, took 0.89 seconds.



The code for SimpleTest is:
[Test]
public void SimpleTest()
{
    Assert.IsFalse(true);
}

If I use the NUnit GUI I get a slightly different exception:
System.IO.FileNotFoundException...<br />
<br />
Server stack trace: <br />
   at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)<br />
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)<br />
   at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)<br />
   at System.AppDomain.Load(String assemblyString)<br />
   at NUnit.Core.Builders.TestAssemblyBuilder.Load(String assemblyName)<br />
   at NUnit.Core.Builders.TestAssemblyBuilder.Build()<br />
   at NUnit.Core.Builders.TestAssemblyBuilder.Build(String testName)<br />
   at NUnit.Core.TestSuiteBuilder.Build(String assemblyName, String testName)<br />
   at NUnit.Core.SimpleTestRunner.Load(String assemblyName, String testName)<br />
   at NUnit.Core.SimpleTestRunner.Load(String assemblyName)<br />
   at NUnit.Core.ProxyTestRunner.Load(String assemblyName)<br />
   at NUnit.Core.ProxyTestRunner.Load(String assemblyName)<br />
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)<br />
   at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)<br />
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)<br />
<br />
Exception rethrown at [0]: <br />
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)<br />
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)<br />
   at NUnit.Core.TestRunner.Load(String assemblyName)<br />
   at NUnit.Util.TestDomain.Load(String assemblyFileName, String testFixture)<br />
   at NUnit.Util.TestLoader.LoadTest(String testName)


Any help would be appreciated.


ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?

-- modified at 8:06 Sunday 26th March, 2006

AnswerRe: An attempt was made to load a program with an incorrect format [SOLVED] Pin
Colin Angus Mackay27-Mar-06 9:17
Colin Angus Mackay27-Mar-06 9:17 
QuestionGrid computing Pin
Mridang Agarwalla26-Mar-06 0:00
Mridang Agarwalla26-Mar-06 0:00 
AnswerRe: Grid computing Pin
Guffa26-Mar-06 1:17
Guffa26-Mar-06 1:17 
QuestionAnother small listview problem Pin
Mridang Agarwalla25-Mar-06 23:50
Mridang Agarwalla25-Mar-06 23:50 
AnswerRe: Another small listview problem Pin
Stefan Troschuetz25-Mar-06 23:54
Stefan Troschuetz25-Mar-06 23:54 
GeneralRe: Another small listview problem Pin
Mridang Agarwalla26-Mar-06 0:13
Mridang Agarwalla26-Mar-06 0:13 
AnswerRe: Another small listview problem Pin
Ravi Bhavnani26-Mar-06 5:01
professionalRavi Bhavnani26-Mar-06 5:01 
QuestionCreating and placing controls on runtime and referencing via SQL string Pin
fracalifa25-Mar-06 23:04
fracalifa25-Mar-06 23:04 
QuestionImage properties Pin
valiovalio25-Mar-06 22:46
valiovalio25-Mar-06 22:46 
AnswerRe: Image properties Pin
Guffa25-Mar-06 23:56
Guffa25-Mar-06 23:56 
GeneralRe: Image properties Pin
valiovalio26-Mar-06 2:05
valiovalio26-Mar-06 2:05 
Questionresizing a button thru mouse???????? Pin
rani baji25-Mar-06 22:20
rani baji25-Mar-06 22:20 
QuestionC# and Inheritance Pin
hung_ngole25-Mar-06 22:00
hung_ngole25-Mar-06 22:00 
AnswerRe: C# and Inheritance Pin
Guffa26-Mar-06 0:10
Guffa26-Mar-06 0:10 
QuestionHow to draw text in Standard mode in CF? Pin
pmasknguyen25-Mar-06 21:48
pmasknguyen25-Mar-06 21:48 
Questionlistview problem Pin
Mridang Agarwalla25-Mar-06 16:49
Mridang Agarwalla25-Mar-06 16:49 
AnswerRe: listview problem [Modified] Pin
Ravi Bhavnani25-Mar-06 16:54
professionalRavi Bhavnani25-Mar-06 16:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.