Click here to Skip to main content
16,017,200 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to check if the function works properly in classlibrary.cs?
I was learning by myself and my function is not working.
Posted
Updated 5-Sep-11 19:12pm
v2
Comments
Prerak Patel 6-Sep-11 1:12am    
Not clear.
Member 8214635 6-Sep-11 1:12am    
whats the problem? explain in brief?

Obviously the output should tell you whether it is working or not.

Debug through the lines of code to see if the function is doing what you want it to do.
 
Share this answer
 
Comments
Espen Harlinn 6-Sep-11 14:06pm    
Good reply - a 5
Abhinav S 6-Sep-11 14:08pm    
Thank you Espen.
When you seriously develop your class libraries, you should develop them in parallel with some test projects which will run immediately during development and ultimately test all your library's features. You can also use NUnt for unit testing, see http://en.wikipedia.org/wiki/NAnt[^], http://nant.sourceforge.net/[^].

—SA
 
Share this answer
 
Comments
Parwej Ahamad 6-Sep-11 3:17am    
Thanks for sharing with us this link. My vote is 5
Sergey Alexandrovich Kryukov 6-Sep-11 9:12am    
You're welcome and thanks. But this product is well known, one of the most popular in .NET and Mono development.
--SA
Espen Harlinn 6-Sep-11 14:07pm    
Good reply - 5'ed
Sergey Alexandrovich Kryukov 6-Sep-11 16:29pm    
Thank you, Espen.
--SA
I think you can debug your code and see where is the issue. OR post here your function code and brief about the function logic.
 
Share this answer
 
Hi,

Once you had developed a classlibrary, let say example my
library is
Algem.WebControls.dll

In my client code I used to register it as example:
   <%@ Page Language="C#" MasterPageFile="~/ui/mwic/MasterPage.master" AutoEventWireup="true"
    CodeFile="Default.aspx.cs" Inherits="_Default" %>
<![CDATA[<%@ Register Assembly="Algem.WebControls" Namespace="Algem.WebControls" TagPrefix="alg" %>
<![CDATA[<%--More code follows...--%>


Then in the body of my client code I use to call it as example:
   <div style="float: right; padding-removed 16px;">
   <alg:thumbviewer id="ThumbViewer2"  runat="server" imageurl="~/mwic/images/cup.jpg" xmlns:alg="#unknown">
      Title="Sample Image Cup" ThumbUrl="~/mwic/thumbs/cup.jpg" Height="75px" Width="90px"
      ModalImagePadding="40px" />
</div>


Lastly I use to defined it in the Web.config as example:
<httphandlers>
   <add verb="GET" path="ThumbHandler.ashx" type="Algem.WebControls.ThumbHandler" />
   <remove verb="*" path="*.asmx" />
   <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
   <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
   <add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</httphandlers>


Note that: If it is functioning will it could run as it expected.
You may also add reference to your library namespace if that library of yours is in your solution project.
Also you could use the debugger break point tag in your library code if that web site of your's is referencing
to it.


Hope this could help...

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Regards,

Algem
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900