http://referencesource.microsoft.com/netframework.aspx

the download page only work under IE ;)

Available Source Code Components

 

Product NameVersionViewDownload
.NET8.0View EULADownload
dotnetfx1434_VistaWin2k8sp150727.1434View EULADownload
FXUpdate307450727.3074View EULADownload
ASP.NET_MVC1.0View EULADownload
WCF3.5SP1View EULADownload
WF3.5SP1View EULADownload
Dotnetfx_Vista_SP250727.4016View EULADownload
Dotnetfx_Win7_3.5.13.5.1View EULADownload
ASP.NET_MVC2.0View EULADownload
.Net4View EULADownload
.NET_3.5_sp1_redist50727.3053View EULADownload
ASP.NET_MVC3View EULADownload
Netfx_3.5.1_Win7SP13.5.1View EULADownload
NET4.5View EULADownload
Net4.5Update1View EULADownload


 
Categories: Asp.net | C# | MVC | Visual studio 10/up | WCF

 Web Api:  vs2013 only
http://www.asp.net/web-api/overview/security/enabling-cross-origin-requests-in-web-api#enable-cors
1. install cors package through package manager console
Install-Package Microsoft.AspNet.WebApi.Cors -pre -project WebService

2. Add to api cofig
 public static class WebApiConfig
    {
        public static void Register(HttpConfiguration config)
        {
            // New code
            config.EnableCors();

            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
            );
        }
    }
3. enable on apiController
namespace WebService.Controllers
{
    [EnableCors(origins: "http://myclient.azurewebsites.net", headers: "*", methods: "*")]
    public class TestController : ApiController
    {
        // Controller methods not shown...
    }
}
4. some time you need $.support.cors = ture; before you make jsonp call



for WCF, congig it in webHttpbinding section of web.config:

 <webHttpBinding>
        <binding name="webHttpBindingWithJsonP" crossDomainScriptAccessEnabled="true" />
      </webHttpBinding>

If you use SignalR.
http://www.asp.net/signalr/overview/hubs-api/hubs-api-guide-javascript-client#crossdomain
var hubConfiguration = new HubConfiguration();
hubConfiguration.EnableCrossDomain = true;
RouteTable.Routes.MapHubs(hubConfiguration);

Client code that specifies a cross-domain connection (with the generated proxy)
$.connection.hub.url = 'http://fabrikam.com/'
$.connection.hub.start().done(init);

Client code that specifies a cross-domain connection (without the generated proxy)

var connection = $.hubConnection('http://fabrikam.com/');



 
Categories: JQuery | MVC | WCF

1. Defined [DataContract] but forget [DataMember] in DTO .You will got return DTO with all member be null or 0;
if all  proprieties are datamember ,just need [Serializable],
but the fields name may be end with  'k__backingfield' if you generate class from service xml in client. 
to fix this, either add [DataMember] to classes, or use the classes in client side also.


2. DataMember use Enum type which first item value not 0,  and didn't initial  the value. it will cause serialize/deserialize issue.
for example,
public enum SessionLOB //Line Of Business
    {
        UnDefined = 1, Auto = 4, InstantRenter = 5, StandardRenter = 32, HomeOwner = 37
    } ;
and with MyDTO has properties lob
public  SessionLOB lob { get; set; }

if the lob was not initialed and not be set a value, you will get null DTO, because it failed to deserialize 0 to SessionLOB 


 
Categories: C# | WCF

1. if net.tcp not enable on the server, you will see "The protocol 'net.tcp' is not supported." error message:



2. You need install and turn on the feature in Control panel\Programs and features:



3. then enable the protocols of your service:



4. set up the binding port:



5. done. it should be work, if not work, check those step again and the binding address in you web.config file.
I will post my service code and client code later.

 
Categories: WCF

from:(http://msdn.microsoft.com/en-us/library/ff647180.aspx)

Step 7: Create a Test Client Application

In this step, you create a Windows Forms application named Test Client to test the WCF service.

  1. Right-click your solution, click Add, and then click New Project.
  2. In the Add New Project dialog box, in the Templates section, select Windows Forms Application.
  3. In the Name field, type Test Client and then click OK to create a Windows Forms application.
  4. Right-click your client project and then click Add Service Reference.
  5. In the Add Service Reference dialog box, set the Service URI: to net.tcp://localhost:8523/WCFTestService and then click Go.
  6. Change the Service reference name: to WCFTestService and then click OK.

Step 8: Test the Client and WCF Service

In this step, you use the test client to ensure that the WCF service is running properly.

  1. In your client project, drag a button control onto your form.
  2. Double-click the button control to show the underlying code.
  3. In the code behind the button click, create an instance of the proxy, and call the DoWork() method of your WCF service.

    When you call the service, your current user security context will automatically be passed to your WCF service. The code should look as follows:

    private void button1_Click(object sender, EventArgs e)
    {
          WCFTestService.MyServiceClient myService = 
             new WCFTestService.MyServiceClient();
          MessageBox.Show(myService.DoWork("Hello World!"));
          myService.Close();
    }
    
    
  4. Right click the client project and then click Set as Startup Project.
  5. Run the client application by pressing F5 or CTRL+F5.

    When you click the button on the form, the message “Welcome Hello World!” should appear.

other ref: 

Host your WCF service with multiple host environment using multiple protocol


 
Categories: WCF

(this one is for 2003 server
http://www.singingeels.com/Articles/Duplex_WCF_Services_Hosted_in_IIS_Using_NetTcp.aspx
)

Below content from unknown source:

step 1

make sure the window services related to was  is running 24/7. Please ensure that svc - integrated handler is working properly in IIS 7.0.  This step is very important. Make sure the IIS 7.0 is working perfectly. You should also have administrative prevliages on you machine.

step 2

In the adminstravtive command  make sure the website is enable to accept the net.tcp protocol or the UI interface in the IIS 7.0 will help  you  to do it. The command is given below. This command should be at the adminstrative command in window server 2008. This process is one time activity.

%windir%\system32\inetsrv\appcmd.exe set site "Default Web Site" -+bindings.[protocol='net.tcp',bindingInformation='8000:*']

step 3

After your web application is created , mapping to your phsyical directory in your machine. You must enable the web application to accept net.tcp protocol.  The sample dos command is given below and this command should be run in the administrative command in window server 2008

%windir%\system32\inetsrv\appcmd.exe set app "Default Web Site/ Application Name” /enabledProtocols:http;net.tcp

step 4

In the Microsoft.NET Framework 3.0, enable the Window Communication Foundation Non-HTTP activation.  Kindly ensure that the two features like Window communication foundation HTTP Activation, XPS Viewer in Microsoft.NET Framework 3.0 should also be enabled.

  • From the Start menu, choose Control Panel.
  • Select Programs and Features.
  • Click Turn Windows Components on or Off.
  • Expand the Microsoft .NET Framework 3.0 node and check the Windows Communication Foundation Non-HTTP Activation feature


step 5

In the Window Features , enable all the features of window process activation service. The features to be enabled are .Net environment, Configuration API ,Process Model.

  • From the Start menu, choose Control Panel.
  • Select Programs and Features.
  • Click Turn Windows Components on or Off.
  • Expand Window Process Activation Process Activation.


step 6

The Turn User Account Control should be turned off , in the case if you are trying to host  WAS service in a new machine. If the user account is turned on then it is not possible to host the WCF Service in IIS 7.0.

  • Click start
  • Go to Setting and click the control panel
  • Select the User Control
  • Click on the Turn User Account Control on or off


step 7

In the Internet Information Service , enable the features which are given below. the IIS Metabase and IIS 6 configuration compatibility which comes under web management tools.

From the Start menu, choose Control Panel.
Select Programs and Features.
Click Turn Windows Components on or Off.
Expand Internet Information Service.

step 8

Microsoft Front Page Server Exemptions Extensions

If Microsoft Front Page Server Exemptions extension is not installed in the machine,
Install using the following URL
       http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1577

step  9 -  ServiceModel Registration Tool (ServiceModelReg.exe)

For information on ServiceModelReg , visit the url which is given below. It is very important

http://msdn.microsoft.com/en-us/library/ms732012.aspx


Sample application for WAS Hosting you can you use from the URL which are given below

http://msdn.microsoft.com/en-us/library/ms752218.aspx


 
Categories: WCF