Click here to Skip to main content
15,914,066 members
Home / Discussions / C#
   

C#

 
GeneralRe: UDP Hole Punching/STUN tutorials/SDK? Pin
Cosby5-Dec-09 12:09
Cosby5-Dec-09 12:09 
AnswerRe: UDP Hole Punching/STUN tutorials/SDK? Pin
Cosby7-Dec-09 2:26
Cosby7-Dec-09 2:26 
GeneralRe: UDP Hole Punching/STUN tutorials/SDK? Pin
srdusad17-Apr-10 0:14
srdusad17-Apr-10 0:14 
Questionhow can i minimize my program i the sytem try ? Pin
ariyanna9-Apr-09 0:09
ariyanna9-Apr-09 0:09 
AnswerRe: how can i minimize my program i the sytem try ? Pin
DaveyM699-Apr-09 0:15
professionalDaveyM699-Apr-09 0:15 
AnswerRe: how can i minimize my program i the sytem try ? Pin
Giorgi Dalakishvili9-Apr-09 0:16
mentorGiorgi Dalakishvili9-Apr-09 0:16 
AnswerRe: how can i minimize my program i the sytem try ? Pin
jaypatel5129-Apr-09 20:46
jaypatel5129-Apr-09 20:46 
QuestionCreate dll Pin
Trih8-Apr-09 23:55
Trih8-Apr-09 23:55 
Hello,
I have a problem which shouldn't be one really. I need to convert a program to a dll but when I compile it with csc I get an empty dll (checked with DumpBin.exe).

I created a small test class and compiled a dll from it but I cannot invoke the method using Dllimport, it says it cannot find an entrypoint named testMethod.

The code:

test.cs:
using System;
namespace test
{
	public class test
	{
		public string testMethod()
		{
			return "test";	
		}
	}
}


dllTest.cs:
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices; 

namespace dllTester
{
	public class dllTester
	{
		[DllImport(@"test.dll", EntryPoint = "testMethod")]
		static extern string testMethod();
		static void Main(string[] args)
		{
			Console.WriteLine(testMethod());
			Console.ReadKey();
		}
	}
}


I compile test.cs: csc /t:library /out:test.dll test.cs without any errors or warnings.
I compile dllTester: csc /out:dllTester.exe dllTester.cs without any errors or warnings.

When I try to run dllTester I get this:

Unhandled Exception: System.EntryPointNotFoundException: Unable to find an entry point named 'testMethod' in DLL 'test.dll'.<br />
   at dllTest.dllTester.testMethod()<br />
   at dllTest.dllTester.Main(String[] args)


Any ideas?

Br
Trih
AnswerRe: Create dll Pin
stancrm9-Apr-09 0:08
stancrm9-Apr-09 0:08 
AnswerRe: Create dll Pin
Giorgi Dalakishvili9-Apr-09 0:08
mentorGiorgi Dalakishvili9-Apr-09 0:08 
AnswerRe: Create dll Pin
dojohansen9-Apr-09 0:34
dojohansen9-Apr-09 0:34 
QuestionStop while loop Pin
yesu prakash8-Apr-09 23:54
yesu prakash8-Apr-09 23:54 
AnswerRe: Stop while loop Pin
stancrm9-Apr-09 0:07
stancrm9-Apr-09 0:07 
GeneralRe: Stop while loop Pin
yesu prakash9-Apr-09 0:24
yesu prakash9-Apr-09 0:24 
GeneralRe: Stop while loop Pin
dojohansen9-Apr-09 0:49
dojohansen9-Apr-09 0:49 
AnswerRe: Stop while loop Pin
Dino Mulahusic9-Apr-09 0:11
professionalDino Mulahusic9-Apr-09 0:11 
AnswerRe: Stop while loop Pin
Rob Philpott9-Apr-09 0:16
Rob Philpott9-Apr-09 0:16 
GeneralRe: Stop while loop Pin
yesu prakash9-Apr-09 0:19
yesu prakash9-Apr-09 0:19 
GeneralRe: Stop while loop Pin
Rob Philpott9-Apr-09 0:26
Rob Philpott9-Apr-09 0:26 
GeneralRe: Stop while loop Pin
Deresen9-Apr-09 2:57
Deresen9-Apr-09 2:57 
GeneralRe: Stop while loop Pin
Rob Philpott9-Apr-09 3:10
Rob Philpott9-Apr-09 3:10 
GeneralRe: Stop while loop Pin
Deresen9-Apr-09 3:16
Deresen9-Apr-09 3:16 
Questionreading excel contents Pin
mist_psycho8-Apr-09 23:30
mist_psycho8-Apr-09 23:30 
AnswerRe: reading excel contents Pin
Rob Philpott9-Apr-09 0:54
Rob Philpott9-Apr-09 0:54 
QuestionGeneric method: Cast an object to a return type T Pin
Spunky Coder8-Apr-09 23:26
Spunky Coder8-Apr-09 23:26 

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.