Windows 2012 Hosting - MVC 6 and SQL 2014 BLOG

Tutorial and Articles about Windows Hosting, SQL Hosting, MVC Hosting, and Silverlight Hosting

WCF Hosting - ASPHostPortal :: Setting up a netTcpBinding enabled WCF Service in IIS 7

clock September 14, 2012 09:06 by author Jervis

netTcpBinding is a secure, reliable binding suitable for cross-machine communication. It uses TCP for message delivery along with a binary message encoding which makes is faster than HTTP based bindings such as WSHttpBinding and BasicHttpBinding.

Hosting a netTcpBinding service in IIS 7 is simple, however it requires several steps.


1. Add Non-HTTP Activation: from the Add Features Wizard select .NET Framework 3.0 Features and add Non-HTTP Activation




2. Make sure the Net.TCP services are running:
netTcpBinding uses two windows services. NetTcpActivator - Receives activation requests over the net.tcp protocol and passes them to the Windows Process Activation Service and NetTcpPortSharing - provides ability to share TCP ports over the net.tcp protocol. This service enables net.tcp ports to be shared across multiple user processes which will make it easier to manage open ports in your network.



3. In IIS navigate to your website and select Advanced Settings from the right menu. Add net.tcp to the Enabled Protocols.




4. In IIS select Bindings from the right menu. Add a new net.tcp binding with the port you wish to use. I used port 808 so my Binding information looks like 808:*






5. From now on the system is ready to run netTcpBinding so you can now add it to web.config:


<system.serviceModel>
      <services>
            <service behaviorConfiguration="MyBehavior"
            name="MyNamespace.MyService">
            <endpoint address=""
                          binding="netTcpBinding"
                          bindingConfiguration="portSharingBinding"
                          name="MyServiceEndpoint"
                          contract="MyNamespace.IMyService">
                  <identity>
                        <dns value="localhost" />
                  </identity>
            </endpoint>
 
            <endpoint address="mex"
                          binding="mexTcpBinding"
                          bindingConfiguration=""
                          name="MyServiceMexTcpBidingEndpoint"
                          contract="IMetadataExchange" />
                  <host>
                        <baseAddresses>
                              <add baseAddress="net.tcp://MyServerIPAddress:808/MyService.svc" />
                        </baseAddresses>
                  </host>
            </service>
      </services>
      <behaviors>
        <serviceBehaviors>
            <behavior name="MyBehavior">
              <serviceMetadata httpGetEnabled="false" />
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
        </serviceBehaviors>
      </behaviors>
      <bindings>
            <netTcpBinding>
                  <binding name="portSharingBinding" portSharingEnabled="true"/>
            </netTcpBinding>
      </bindings>
</system.serviceModel>


A mexTcpBinding endpoint is needed in order to use IMetadataExchange over TCP. IMetadataExchange exposes methods used to return metadata about a service. Now the service should be up and running so from Visual Studio just add a Service reference. Point the reference to:
net.tcp://MyServerIPAddress:808/MyService.svc. It should generate the following configuration

<system.serviceModel>
          <bindings>
                    <netTcpBinding>
                             <binding name="MyServiceEndpoint" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="65536">
                                      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                                      <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
                                      <security mode="Transport">
                                               <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
                                               <message clientCredentialType="Windows" />
                                      </security>
                             </binding>
                    </netTcpBinding>
          </bindings>
          <client>
                    <endpoint address="net.tcp://MyServerName/MyService.svc" binding="netTcpBinding" bindingConfiguration="MyServiceEndpoint" contract="MyNamespace.IMyService" name="MyServiceEndpoint">
                              <identity>
                                        <dns value="localhost" />
                              </identity>
                    </endpoint>
          </client>
</system.serviceModel>


Now you are ready to use the service from the client you generated:


using (MyServiceClient client = new MyServiceClient())
{
        client.Open();
        client.MyMethod();
        client.Close();
}


That’s it. You should be able to communicate with your service faster and more efficiently than any HTTP based binding

 



WCF Hosting - ASPHostPortal :: How to Solve The page you are requesting cannot be served because of the extension configuration

clock October 5, 2011 07:28 by author Jervis

Error Message:

HTTP Error 404.3 – Not Found

The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map. Detailed Error InformationModule StaticFileModule.

How to Solve it:

1. Start --> All Programs --> Microsoft Visual Studio 2008 --> Visual Studio Tools --> Open Visual Studio Command Prompt.

2. Run Visual Studio 2008 Command Prompt as “Administrator” if you are using Windows7. After that navigate to

C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation 



3. After that Run this command
servicemodelreg –i



4. After run servicemodelreg -i all components will install successfully now run your hosted WCF service will work perfectly.

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:

-
DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



Windows 2008 Hosting - ASPHostPortal :: Hosting a WCF Service in IIS 7 and Windows 2008

clock March 11, 2011 09:06 by author Jervis

Here are the steps:

1.
Build your Service Library in release mode.

2. Go to your Win2k8 server, and add the "Web Server" role - make sure ASP.NET is enabled.

3. Create a dir on your disk - I put mine in c:\code\HelloWorld <-- this will be the physical directory that will run my WCF service.

4. Fix the security on this dir by adding the following permissions
- Ensure that "Network Service" has Read & Execute + List folder contents + Read.
- Ensure that  IIS_IUSRS have Read & Execute + List folder contents + Read.

5. Now, go to IIS MGR, and add a new application pool called "Hello World". Ensure that this Application Pool is set to the settings as shown below



6. Next, create a website in IIS7 with the following settings



7. Are we done yet? Heck no! Apparently, WCF .. doesn't work with IIS 7 OOTB. So you need to run command prompt as administrator, and run the following command

"%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -r –y

8. Now, the DLL that you created in step #1, copy that to C:\Code\HelloWorld\Bin .. where C:\Code\HelloWorld is the physical path of my website

9. Next, create a file called HelloWorld.svc at C:\Code\HelloWorld with the following text in it

<% @ServiceHost Service="MyServices.HelloWorld" %>

10. Next, create a web.config with the following

<?xml version="1.0" encoding="utf-8"?>

<configuration>
  <system.serviceModel>
    <services>
      <service behaviorConfiguration="MyServices.HelloWorldBehavior" name="MyServices.HelloWorld">
        <endpoint address="" binding="wsHttpBinding" contract="MyServices.IHelloWorld" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8000/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="MyServices.HelloWorldBehavior">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

As you can see, I have set a base address of http://localhost:8000 <-- change that to what suits you. Also, I have created 2 endpoints, one uses wsHttpBinding, and the other uses mexHttpBinding

11. Now browse to this URL - http://localhost:8000/HelloWorld.svc, you should see the service hosted as shown below



12. Done. Great job!!

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.


You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



About ASPHostPortal.com

We’re a company that works differently to most. Value is what we output and help our customers achieve, not how much money we put in the bank. It’s not because we are altruistic. It’s based on an even simpler principle. "Do good things, and good things will come to you".

Success for us is something that is continually experienced, not something that is reached. For us it is all about the experience – more than the journey. Life is a continual experience. We see the Internet as being an incredible amplifier to the experience of life for all of us. It can help humanity come together to explode in knowledge exploration and discussion. It is continual enlightenment of new ideas, experiences, and passions


Author Link


Corporate Address (Location)

ASPHostPortal
170 W 56th Street, Suite 121
New York, NY 10019
United States

Sign in