Bug 321145 (MONO78407) - [PATCH] ArgumentException when path is specified for linked resource
Summary: [PATCH] ArgumentException when path is specified for linked resource
Status: RESOLVED FIXED
Alias: MONO78407
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 1.1
Hardware: Other All
: P3 - Medium : Minor
Target Milestone: ---
Assignee: Gert Driesen
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-15 22:21 UTC by Gert Driesen
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Fix (839 bytes, patch)
2006-05-15 22:24 UTC, Thomas Wiest
Details | Diff
Fix (for mcs and gmcs) and test (3.52 KB, patch)
2006-05-16 20:57 UTC, Thomas Wiest
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:58:57 UTC


---- Reported by gert.driesen@pandora.be 2006-05-15 15:21:27 MST ----

mcs report the following exception when a filename with path information 
is specified as value for /linkresource:

Unhandled Exception: System.ArgumentException: 
fileName '/home/monohead/mono-test-projects/Service.cs' must not include 
a path.
in <0x00324> 
System.Reflection.Emit.AssemblyBuilder:check_name_and_filename 
(System.String name, System.String fileName, Boolean fileNeedsToExists)
in <0x00020> System.Reflection.Emit.AssemblyBuilder:AddResourceFile 
(System.String name, System.String fileName, ResourceAttributes 
attribute, Boolean fileNeedsToExists)
in <0x00015> System.Reflection.Emit.AssemblyBuilder:AddResourceFile 
(System.String name, System.String fileName, ResourceAttributes attribute)
in <0x00026> Mono.CSharp.Resources+LinkedResource:Emit ()
in <0x00112> Mono.CSharp.Resources:Emit ()
in <0x00cca> Mono.CSharp.Driver:MainDriver (System.String[] args)
in <0x00042> Mono.CSharp.Driver:Main (System.String[] args)

The attached patch fixes this issue.

Let me know if it's ok to commit.  Should I also commit this change for 
gmcs ?



---- Additional Comments From gert.driesen@pandora.be 2006-05-15 15:24:07 MST ----

Created an attachment (id=169848)
Fix




---- Additional Comments From rharinath@novell.com 2006-05-16 04:09:20 MST ----

Can you verify that this is the behaviour of CSC?  What does it do if
-linkresource is given a path?




---- Additional Comments From gert.driesen@pandora.be 2006-05-16 13:57:54 MST ----

Created an attachment (id=169849)
Fix (for mcs and gmcs) and test




---- Additional Comments From gert.driesen@pandora.be 2006-05-16 14:00:21 MST ----

After my patch, we now match the behavior of csc: for linked 
resources only the filename is used.

I've attached a new patch which also fixes the issue in gmcs, and 
adds a test.



---- Additional Comments From rharinath@novell.com 2006-05-17 07:26:51 MST ----

Looks good.  Please apply.



---- Additional Comments From gert.driesen@pandora.be 2006-05-17 16:01:27 MST ----

Fixed in svn (revision 60797).

This bug blocked bug(s) 78384.
Imported an attachment (id=169848)
Imported an attachment (id=169849)