.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Post New Web Links

How to debub wcf code whose reference added to web aplication

Posted By:      Posted Date: October 15, 2010    Points: 0   Category :ASP.Net

 Hello friends,

Can anybody tell me please how to debug the wcf code. Means I have added refernce of wcf code in my web appilcation's code and called that wcf function in my web application code. Both applications are on my local machine. I have put up break point in web application and also put up break point at the function in wcf. Can break point swicth from web application to wcf code.? Is ther any way to do this or any other way to do like this so  that I can debug the function in wcf. I'll be very thankfull.

Thanks and regards,


View Complete Post

More Related Resource Links

Custom tool error: Failed to generate code for the service reference 'CompanyService'. Please che


A little background because I feel I have an out of the ordinary architecture in place and don't know if this is contributing to the problem. 

We have an existing ASP.net application that is undergoing expansion.  The new functionality is all written in Silverlight 4.  As part of that expansion I gutted all the old Linq to SQL and put Entity Framework 4 into place.  To do this I created a standard .net Class Library and added my edmx files there.  Naturally, the business entities created by this cannot be used in Silverlight.  So I created a Silverlight Class Library and added all the business entities to that Silverlight Class Library as linked files.  I changed the name space to be the same.

So I have the following assembly / namespaces

Company.Project.Dal.csproj / Company.Project.Entities (.net 4 class library)

Company.Project.Entities.csproj / Company.Project.Entities (SL4 class library)

With this architecture I was able to share my business entities with my SL enabled web services, my asp.net projects, my silverlight projects.  Really it's a beautiful thing.

Once this was done I added "message" classes to Company.Project.Dal and again shared them with the other entites using linked files.  These messages are things like MyObjectRequest; they are class

Getting error when a reference is added

Hi,      I am new to .Net, i am getting error when i add a reference to my project, i am attaching the error screen shot here, Do i need to addd any reference path anywhere else, i am using VS 2008. Thanks RaviWorking as a software engineer

Reference.vb file not added

Hi, After adding WCF service reference, Reference.vb file is not getting added in my client code. What could be the reason ? I added service in following steps: 1. Selected option "Add Service reference" 2. Discover Services in this solution 3. Added Service Reference. After adding service reference, following files got created in App_WenReference folder: Folder TestServiceReference Within folder TestServiceReference, following files got created: Configuration.svcinfo TestService.disco TestService.wsdl TestService.xsd TestService1.xsd TestService2.xsd TestService3.xsd TestService4.xsd But Reference.vb file is not added. What could be the reason ?Amit Lohakare

Why request parameter added to client side code in each method while using svcutil.exe

Hi, I am using WCF services in my project and want to call WCF methods asynchronously. I am hosting WCF service programmatically in windows app as follows svc = New ServiceHost(GetType(Service1), New Uri("net.tcp://localhost:8806/")) Dim svcMDB As New ServiceMetadataBehavior svc.Description.Behaviors.Add(svcMDB) svc.AddServiceEndpoint(GetType(Service1), New NetTcpBinding(), "MyBusiness/MyBusinessService/") svc.AddServiceEndpoint(ServiceMetadataBehavior.MexContractName, MetadataExchangeBindings.CreateMexTcpBinding(), "MyBusiness/MyBusinessService/mex") svc.Open() Me.Text = "Service started...." and I am generating client side proxy using svcutil.exe as follows. svcutil /n:net.tcp://localhost:8806/MyBusiness/MyBusinessService,MyService net.tcp://localhost:8806/MyBusiness/MyBusinessService/mex /a /language:vb   The result of this command is as :   Microsoft (R) Service Model Metadata Tool [Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152] Copyright (c) Microsoft Corporation.  All rights reserved.   Attempting to download metadata from 'net.tcp://localhost:8806/MyBusiness/MyBusi nessService/mex' using WS-Metadata Exchange. This URL does not support DISCO. Generating files... D:\Prabodh\New C2k\Test Projects\DataTableToArray\MyHost\bin\Debug\MyBusinessSer vice.vb D:

Reference to a non-shared member requires an object reference in code generated by ASP.NET



I am working on converting a project from C# to VB and am facing this weird issue. 1 page cannot compile and I get the reference error, but the weird thing is that the compiler shows the error as coming from ASP.NET generated code. Visual Studio shows me that error is coming from my ASPX page. I cannot seem to figure out why or where this error is occuring. Also if I take the inherits attribute out I don't get the compilation error. The code in aspx page is below:

<%@ Page Language="VB" AutoEventWireup="true" CodeBehind="diff.view.aspx.vb"  Inherits="MR.ControlApp.diffview" MasterPageFile="~/Site1.Master"%>

<asp:Content ID="Header1" ContentPlaceHolderID="head" runat="server">

    Page: <select onchange="sel(this);">
        Dim j As Integer = 0
        While j < pageCount
           <option <%= IIf(currentPage = ( j + 1 ), "selected", "")  %> value="<%= j+1 %>"><%= j + 1 %></option>
        <%j = j + 1
        End While
    <% 'Print(); %>
    <div style="font-family: verdana; font-size: 10pt; font-weight: bold">
        MDM Data Inconsiste

Items added through Javascript to a dropdownlist are not accessible through code behind


Hi All,

I am successfully able to add new items to a drop down list using Javascript.

The script I am using is 

        function FillJavaScriptValues() {
            var ddlDeliveryVan;
            ddlDeliveryVan = document.getElementById("DropDownList1");
            var opt = document.createElement("option");

How to Bind to an Object Resource Added From Code Behind?


So if I do something like this in the code behind:

MyObject newObj = new MyObject;

newObj.Description = "This is a test";


How could I bind to this resource or at least access its indivudal properties? So in XAML I might have a textbox which I want to bind to the newObj's "Description" property. I found if instead of setting the resource to the entire object but just the string I could do the following:

<TextBox Text="{DynamicResource ResourceKey=resource1}" 

 But I would rather set the resource to the entire object and then use "Path=/Description" for the textbox. Could someone give me an example of how this would be done? Basically, I just need to know what to do in XAML to access individual property of my resource I added.

Client Side Code added to a file .txt when uploaded - FileUpload, VB.net



im tryin to upload files to the database using the FileUpload. the upload take place. when i download the file again ( word document, excel document.. a text document (.txt), a winzip file) , it turns that the file is corrupted and cannot be opened.. an image file or an mp3 file doesnt present this problem.

my application is developped usin vb.net 2010 and sql server 2005 as the database.. 

i searched the internet and the forums here but ive couldnt find an answer of what is happening wiz me..

ill present here the upload function and the download function.. plz help.

Protected Sub btn_upload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_upload.Click
        If Me.file_upload_case.HasFile = True Then
            Dim contentType As String = file_upload_case.PostedFile.ContentType
            Dim fileData As Byte() = New Byte(file_upload_case.PostedFile.InputStream.Length) {}

            file_upload_case.PostedFile.InputStream.Read(fileData, 0, fileData.Length)
            Dim originalName As String = Path.GetFileName(file_upload_case.PostedFile.FileName)

            Dim u As New UploadFileC
            u.CaseBranchP = Me.combo_branch_code.SelectedValue.ToString
            u.CaseIDP = Convert.ToInt64(Me.txt_case_number.Text)

Reference query values from custom code


How can I reference query values from custom code?

Normally in the expression I can use Fields!QueryValueX.Value

In custom code I can reference textboxes, for example - if ReportItems are passed as the parameter

But this doesnt include the query items

Javier Guillen

Can't reference Control in Code Behind?


Hey guys,

I've got a very odd issue.

I'm getting an "Object Reference Not Set to an Instance Of An Object Error" in a Web User Control that I've created when referencing any control in the Code Behind. Intellisense reports that the control exists in the aspx, but whenever I build and run I get that error.

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim ImageURL As String = "~/Assets/IMG/"

        Select Case StatusType
            Case "Done"
                ImageURL += "Indicator_Done.png"
                panTaskItem.CssClass = "TaskItem-Green"
            Case "NotDone"
                ImageURL += "Indicator_NotDone.png"
                panTaskItem.CssClass = "TaskItem-Neutral"
            Case "Warning"
                ImageURL += "Indicator_Warning.png"
                panTaskItem.CssClass = "TaskItem-Yellow"
        End Select

        imgIndicator.ImageUrl = ImageURL
        lblTaskTitle.Text = TaskTitle
        lblTaskDescription.Text = TaskDescription

    End Sub

<asp:Panel ID="panTaskItem" runat="server" Width="100%">

    <div style="flo

Code analysis complaint (CA2000: Dispose objects before losing scope) on dynamically added control


It appears as though CA2000 was added to the code analysis for VS2010.


We have a bunch of code that dynamically adds controls during the CreateChildControls method. On various control types, we're getting this CA2000 complaint. I changed a bunch of controls to use a Using statement. When doing this on a AjaxControlToolkit.AlwaysVisibleControlExtender control, it caused the control to always appear at the bottom of the page rather than staying always visible. In the base class of this control, I noticed that there is logic to do things differently during PreRender if dispose had previously been called.


What is the proper way to satisfy CA2000 on a control like this while adding the control dynamically during CreateChildControls?

This is how the code was when getting CA2000.

            Dim alwaysVisibleControlExtender As New AjaxControlToolkit.AlwaysVisibleControlExtender
            With alwaysVisibleControlExtender
                .ID = Me.ID & "AlwaysVisibleControlExtender"
                .TargetControlID = m_AccordionAlwaysVisiblePanel.ID
                .VerticalSide = AjaxControlToolkit.VerticalSide.Top
                .HorizontalSide = AjaxControlToolkit.HorizontalSide.Center

Errors after adding a web reference in code


after adding a web reference in my code m gettiing somany errors lyk-Error 1 The type or namespace name 'XmlNode' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\288122\My Documents\Visual Studio 2005\Projects\New Folder\MovingFiles\MovingFiles\Form1.cs 
this code is for moving attachment  from a custom list in share point

into folder

tanvi sharma

svcutil ( wrong code) and add service reference (works smoothly)


Hi all,

I have a web service at java and I want to consume it with wcf. When I use add service reference to create the proxy everything works ok! When I tried to generate the proxy with svcutil it's generates me two files (*.cs and app.config) which I think is all I need. But nothing works, no errors but when I try to call the services I get nothing!!! But in the case you can't use add service reference (like an authenticated scenario which is the next step for me) what can I do? Why is this happening?Can someone help me?


Code Optimized Web Development Profile (VS 2010 and .NET 4.0 Series)

When you first run VS 2010 it prompts you to select an IDE profile to use. The profile you select will configure how tool windows are displayed/docked in the IDE by default and set the default keyboard shortcuts. You can then customize any of these settings by using the Tools->Options menu within the IDE and then override/change them. You can also later reset your profile and pick a different one by choosing the Tools->Import and Export Settings menu command.

A better way to reference your wizard steps using named steps

Note: this article uses the plain vanilla but the concepts apply equally well to its popular counterpart .

By far the most common way that I see wizard steps reference in code snippets is by their index.

Free Code Snippets - ASP.NET

You Can Find Useful ASP.NET Related Posts on the above link.

Free Code Snippets - C#

Free C# Code Snippets
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend