简体   繁体   English

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

[英]Creating C# DLL, what am I doing wrong?

A little background : I'm writing a set of C# classes to wrap a SOAP connector to another system called Jira . 一些背景知识 :我正在编写一组C#类,以将SOAP连接器包装到另一个名为Jira的系统。 The SOAP connector which Jira exposes has too many functions for my purposes, so I'm attempting to simplify the interface. 为了我的目的,Jira公开的SOAP连接器具有太多功能,因此我尝试简化该接口。

My setup : In C#/Visual Studio 2010, my solution is laid out as follows: 我的设置 :在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 is in the JiraService namespace. Jira.cs在JiraService命名空间中。 Comment.cs, Issue.cs, Project.cs, and User.cs are all in the JiraService.Types namespace. Comment.cs,Issue.cs,Project.cs和User.cs都在JiraService.Types命名空间中。 Jira.cs essentially exposes a few methods which either take or return the classes found in the Types directory. Jira.cs本质上公开了一些采用或返回在Types目录中找到的类的方法。 Under the properties I have the Default namespace set to JiraService and the Output type set to Class Library. 在属性下,我将默认名称空间设置为JiraService,将输出类型设置为类库。

My Problem : When I build the solution I get out JiraService.dll . 我的问题 :构建解决方案时,我退出了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. 当我将此引用添加到另一个项目时,Jira,Comment,Issue,Project和User类不在包含的.dll的JiraService或JiraService.Types命名空间中。 The only available namespace is JiraService.devjira.soap , which is the library I'm trying to simplify and hide! 唯一可用的名称空间是JiraService.devjira.soap ,这是我要简化和隐藏的库! What am I doing wrong? 我究竟做错了什么? Why are my classes not showing up in the final library? 为什么我的课程没有出现在最终图书馆中?

Thanks for all your help! 感谢你的帮助!

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? 1.您是否在所有类中正确命名了名称空间? Folder structure doesn't matter, its the namespace attribute that counts. 文件夹结构无关紧要,它的名称空间属性很重要。 2. Are your classes public? 2.您的课程公开吗?

Beyond that, post some sample code please.. 除此之外,请发布一些示例代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM