English 中文(简体)
A. 大会出入
原标题:Assembly access
  • 时间:2010-08-28 01:13:10
  •  标签:
  • c#
  • .net

If you have a assembly identity/namespace of Library.Testing. Then you created another assembly with identity/namespace of Library.Testing.One Library.Testing.One project references Library.Testing.

为什么要使用<代码>使用图书馆。 测试;。 1 查阅Library>任何内容?

例1:

using System;

namespace Library.Testing.One
{
    //  Library.Testing  is a reference in this assembly
    public class foo : Library.Testing.BooBase
   {
   }
}

这不是我有两个例外。

Warning 1 Load of property RootNamespace failed. The string for the root namespace must be a valid identifier. Error 2 The type or namespace name BooBase does not exist in the namespace Library.Testing.One.Library.Testing (are you missing an assembly reference?)

例2:

using System;
using Library.Testing;

namespace Library.Testing.One
{
    //  Library.Testing  is a reference in this assembly
    public class foo : Library.Testing.BooBase
   {
   }
}

工作!

问题回答

添加“使用”栏目。 测试。 1 并不自动在<条码>和<条码>上添加所有内容。 测试的范围。 名称空间似乎属于等级,这可能会导致你混淆。

例如,在档案中增加<编码>使用系统。 该图自动将<编码>系统和<编码>.System.Data的所有内容纳入范围。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签