Bug 18768 - mkbundle Assembly CodeBase uses Current Working Directory
Summary: mkbundle Assembly CodeBase uses Current Working Directory
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: Tools (show other bugs)
Version: 3.2.x
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-04-02 17:59 UTC by dabitp
Modified: 2014-04-02 18:38 UTC (History)
3 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description dabitp 2014-04-02 17:59:42 UTC
Operating System: (Mac OSX Mavericks) Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64

Mono Version: Mono JIT compiler version 3.2.6 ((no/9b58377 Thu Jan 16 17:49:56 EST 2014)

Simple Console Application:

	class MainClass
	{
		public static void Main (string[] args)
		{
			Console.WriteLine (Assembly.GetExecutingAssembly().CodeBase);
		}
	}

When executing the produced program either in the Xamarin Studio debugger or via:

mono assemblyName.exe

it works as expected. 

When I use mkbundle to compile the application it returns the incorrect output. It appears to use the current directory appended by the assembly name instead of showing the directory of the assembly.

Expected and working output without using a mkbundle executable:
file:///Users/dab/Projects/testAssembly/testAssembly/bin/Debug/testAssembly.exe

Incorrect output of the same executable generated by mkbundle:
file:///Users/dab/Projects/testAssembly/testAssembly/bin/testAssembly.exe
Comment 1 dabitp 2014-04-02 18:38:56 UTC
I think I forgot to mention that this error occurs when you are in a directory that does not contain the executable. So I ran the mkbundle via ./Debug/testAssembly.mac

Note You need to log in before you can comment on or make changes to this bug.