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

Submitted by:  Radek Polak <radekp>
Submitted on:  Tue 01 Mar 2005 01:52:42 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Invalid
Privacy: PublicAssigned 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>
Project 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>
Project Member

 

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

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 3 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sat 05 Mar 2005 04:53:34 AM UTCptahStatusNone=>Invalid
  Open/ClosedOpen=>Closed
Tue 01 Mar 2005 01:52:42 PM UTCradekpAttached File-=>Added namespace_test.tar.gz, #2251

Back to the top


Powered by Savane 3.1-cleanup1