简体   繁体   中英

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 . 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!

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..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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