bugDotGNU Portable.NET - Bugs: bug #12182, Problem is with resolving fully...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #12182: Problem is with resolving fully qualified static metod from referenced dlls

Submitter:  Radek Polak <radekp>
Submitted:  Tue 01 Mar 2005 01:52:42 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Invalid
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Sat 05 Mar 2005 04:53:34 AM UTC, comment #2: 

Both assemblies have the name "a": "a.dll" and "a.exe". Thus, when a.exe tries to load the type "MyNamespace.M,a", which is defined in a.dll, .NET doesn't understand we want to look in a.dll, but looks only in a.exe

As shown by Kirill Kononenko, this is the case with both Microsoft and DotGNU, and the correct behaviour.

Bug invalid, closed on 5th Mars 2005.

Carl-Adam Brengesjo <ptah>
Group Member
Fri 04 Mar 2005 09:17:13 PM UTC, comment #1: 


H:\GetDotGNU\bugs\namespace_test>cscc -shared MyClass.cs


H:\GetDotGNU\bugs\namespace_test>cscc Main.cs /r:a.dll


H:\GetDotGNU\bugs\namespace_test>a.exe

Unhandled Exception: System.TypeLoadException: Could not load type MyNamespace.M
yClass from assembly a, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null.
   at Class1.Main(String[] args)

H:\GetDotGNU\bugs\namespace_test>ilrun.exe a.exe
unresolved type: [a]MyNamespace.MyClass
a.exe: unresolved external references


Kirill Kononenko <krokas>
Tue 01 Mar 2005 01:52:42 PM UTC, original submission:  

Simple test case

// MyClass.cs
//
// compile with cscc -shared MyClass.cs

using System;

namespace MyNamespace
{
public class MyClass
{
public static void Test()
{
Console.WriteLine("Hi");
}
}
}

// Main.cs
//
// compile with cscc Main.cs /r:a.dll
using System;
using MyNamespace;

class Class1
{
static void Main(string[] args)
{
MyNamespace.MyClass.Test();
}
}

This error is thrown by cscc:
`MyNamespace' is not declared in the current scope

mcs and csc compile without problems.

You can also compile with: cscc MyClass.cs Main.cs and everything is fine.

The problem can be workaround if you uncomment line with using MyNamespace

So problem is with resolving fully qualified static metod from referenced dlls

Radek Polak <radekp>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #2634:  namespace_test.tar.gz added by radekp (427B - application/x-gzip - Test program for this bug)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-03-05 ptah StatusNone Invalid
    Open/ClosedOpen Closed
2005-03-01 radekp Attached File- Added namespace_test.tar.gz, #2251

Back to the top

Powered by Savane 3.13-02a9.
Corresponding source code