创建 C# DLL,我做错了什么?

发布于 2024-12-13 17:21:29 字数 1236 浏览 0 评论 0原文

一点背景:我正在编写一组 C# 类来将 SOAP 连接器包装到另一个名为 吉拉。 Jira 公开的 SOAP 连接器对于我的目的而言功能太多,因此我尝试简化接口。

我的设置:在 C#/Visual Studio 2010 中,我的解决方案布局如下:

JiraService
    Properties/
        AssemblyInfo.cs
        Settings.settings/
    References/
        ...
        System.Web.Services
    Web References
        devjira.soap /* my connector to the jira soap reference i'm wrapping */
    Types/  /* these are data classes i'm trying to expose for the user */
        Comment.cs
        Issue.cs
        Project.cs
        User.cs
    app.config
    Jira.cs /* main class I'm trying to provide to user */

Jira.cs 位于 JiraService 命名空间中。 Comment.cs、Issue.cs、Project.cs 和 User.cs 均位于 JiraService.Types 命名空间中。 Jira.cs 本质上公开了一些方法,这些方法要么获取或返回在 Types 目录中找到的类。在属性下,我将默认命名空间设置为 JiraService,将输出类型设置为类库。

我的问题:当我构建解决方案时,我得到了JiraService.dll。当我将此引用添加到另一个项目时,Jira、Comment、Issue、Project 和 User 类不在包含的 .dll 的 JiraService 或 JiraService.Types 命名空间中。唯一可用的命名空间是 JiraService.devjira.soap,这是我试图简化和隐藏的库!我做错了什么?为什么我的课程没有出现在最终的库中?

感谢您的帮助!

A little background: I'm writing a set of C# classes to wrap a SOAP connector to another system called Jira. The SOAP connector which Jira exposes has too many functions for my purposes, so I'm attempting to simplify the interface.

My setup: In C#/Visual Studio 2010, my solution is laid out as follows:

JiraService
    Properties/
        AssemblyInfo.cs
        Settings.settings/
    References/
        ...
        System.Web.Services
    Web References
        devjira.soap /* my connector to the jira soap reference i'm wrapping */
    Types/  /* these are data classes i'm trying to expose for the user */
        Comment.cs
        Issue.cs
        Project.cs
        User.cs
    app.config
    Jira.cs /* main class I'm trying to provide to user */

Jira.cs is in the JiraService namespace. Comment.cs, Issue.cs, Project.cs, and User.cs are all in the JiraService.Types namespace. Jira.cs essentially exposes a few methods which either take or return the classes found in the Types directory. Under the properties I have the Default namespace set to JiraService and the Output type set to Class Library.

My Problem: When I build the solution I get out JiraService.dll. When I add this reference to another project, the Jira, Comment, Issue, Project, and User classes are not in the JiraService or JiraService.Types namespaces of the included .dll. The only available namespace is JiraService.devjira.soap, which is the library I'm trying to simplify and hide! What am I doing wrong? Why are my classes not showing up in the final library?

Thanks for all your help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤独岁月 2024-12-20 17:21:29

需要查看代码才能确定,但​​需要检查一些事项;
1. 您是否在所有类中正确命名了名称空间?文件夹结构并不重要,重要的是命名空间属性。
2.你们的课程是公开的吗?

除此之外,请发布一些示例代码..

Need to see code to tell for sure, but a few things to check;
1. Did you name your namespaces correctly in all the classes? Folder structure doesn't matter, its the namespace attribute that counts.
2. Are your classes public?

Beyond that, post some sample code please..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文