Who's Online
12 visitors online now
1 guests, 11 bots, 0 members
Support my Sponsor

SharePoint site down “An application error occurred on the server” web.config error

Hi All,

 

Recently I got below error message which you might have seen. This is a very common and generic error message which can confuse you a lot. You may face this issue in all versions of SharePoint like SharePoint 2007, 2010, 2013 or SharePoint 2016. First let us look at the error message
#################### Error Start #############
Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be view able on remote machines, please create a <customErrors> tag within a “web.config” configuration file located in the root directory of the current web application. This <customErrors> tag should then have its “mode” attribute set to “Off”.

<!– Web.Config Configuration File –>

<configuration>
<system.web>
<customErrors mode=”Off”/>
</system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the “defaultRedirect” attribute of the application’s <customErrors> configuration tag to point to a custom error page URL.

<!– Web.Config Configuration File –>

<configuration>
<system.web>
<customErrors mode=”RemoteOnly” defaultRedirect=”mycustompage.htm”/>
</system.web>
</configuration>

#################### Error End #############

We can see that error message says something about web.config file. Here is what we need to do.
1. Open IIS management console
2. Start > RUN > Inetmgr > Expand server
3. Expand the site you are getting this error on > right click > explore

Here you should be able to see a web.config file. If this web.config was recently modified by someone, please check with your team if anyone has recently modified this file, tried to deployed a farm\web application solution or run psconfig wizard on any of the SharePoint server in farm.
Note: If you have multiple SharePoint server, try the same on all the servers

In most cases, it is a web.config change done by someone from within the team which cause this issue.
If no one has done any changes:
1. Make a copy of this web.config file and open the original file. Search for “callstack” and set the value to True, again search for customerrors set it to OFF.
2. Rename the recent web.config to web.config.old with today’s date and revert the most recent web.config(date and time) file to web.config
3. Install Examdiff tool on a computer and copy the most recent web.config file and new web.config to identify the changes.

These steps will help you identify the actual cause of this error.

 

What Is Windows Communication Foundation(WCF)

Windows Communication Foundation (WCF) is a .NET framework for developing, configuring and deploying services. It is introduce with .NET Framework 3.0.It is service oriented technology used for exchanging information. WCF has combined feature of .NET Remoting, Web Services and few other communications related technology.

Key Feature of WCF:

  1. Interoperable with other Services
  2. Provide better reliability and security compared to ASMX web services.
  3. No need to make much change in code for implementing the security model and changing the binding. Small changes in the configuration will make your requirements.

Difference between WCF and Web service

Web Service WCF
It can be hosted in IIS It can be hosted in IIS, windows activation service, Self-hosting, Windows service.
[WebService] attribute has to be added to the class and [WebMethod] attribute represents the method exposed to client

Example.

[WebService]

public class myService: System.Web.Services.Webservice

{

[WebMethod]
public string Test()
{
return “Hello! Web Services”;
}

}

 

 

 

 

 

[ServiceContract] attribute has to be added to the class and [OperationContract] attribute represents the method exposed to client

Example:

[ServiceContract]

public Interface InterfaceTest

{

[OperationContract]
string Test();
}

public class myService:InterfaceTest

{

public string Test()
{

return “Hello! WCF”;
}

}

 

Can be access through HTTP Can be access through HTTP, TCP, Named pipes.
One-way, Request- Response are the different operations supported in web service. One-Way, Request-Response, Duplex are different type of operations supported in WCF.
System.Xml.Serialization name space is used for serialization. System.Runtime.Serialization namespace is used for serialization.
Can not be multi-threaded. Can not be multi-threaded.
For binding it uses SOAP or XML Support different type of bindings (BasicHttpBinding, WSHttpBinding, WSDualHttpBinding etc )

WCF Services has three important companent.

  1. Service Class – A WCF service class implements some service as a set of methods.
  2. Host Environment- It can be a application or a Service or a Windows Forms application or IIS as in case of the normal asmx web service in .NET.
  3. EndpointsAll the WCF communications are take place through end point.

Endpoints consist of three component Address, Binding and contract. They collectively called as ABC’s of endpoints.

Address: It is basically url address where WCF services is hosted.

Binding: Binding will describes how client will communicate with service.

Binding supported  by WCF

Binding

Description

BasicHttpBinding

Basic Web service communication. No security by default

WSHttpBinding

Web services with WS-* support. Supports transactions

WSDualHttpBinding

Web services with duplex contract and transaction support

WSFederationHttpBinding

Web services with federated security. Supports transactions

MsmqIntegrationBinding

Communication directly with MSMQ applications. Supports transactions

NetMsmqBinding

Communication between WCF applications by using queuing. Supports transactions

NetNamedPipeBinding

Communication between WCF applications on same computer. Supports duplex contracts and transactions

NetPeerTcpBinding

Communication between computers across peer-to-peer services. Supports duplex contracts

NetTcpBinding

Communication between WCF applications across computers. Supports duplex contracts and transactions

BasicHttpBinding

Basic Web service communication. No security by default

WSHttpBinding

Web services with WS-* support. Supports transactions

Contract: The endpoints specify a Contract that defines which methods of the Service class will be accessible via the endpoint; each endpoint may expose a different set of methods. It is standard way of describing what the service does.

Mainly there are four types of contracts available in WCF.

  1. Service Contract: describe the operation that service can provide.
  2. Data Contract: describes the custom data type which is exposed to the client.
  3. Message Contract: WCF uses SOAP message for communication. Message Contract is used to control the structure of a message body and serialization process. It is also used to send / access information in SOAP headers. By default WCF takes care of creating SOAP messages according to service DataContracts and OperationContracts.
  4. Fault Contract: Fault Contract provides documented view for error occurred in the service to client. This help as to easy identity the what error has occurred, and where. By default when we throw any exception from service, it will not reach the client side.

Creating WCF service in visual studio 2013:

 

  • First open Visual Studio 2013. Create a new project and select WCF Service Application and give it the name WcfService1.

wcf service

  • Delete default created  IService1.cs and Service1.svc file.
  • Right-click on the project and select  “Add” | “New Item…”
  • From the Web tab choose WCF Service to add.
  • give the service the name “HELLO.svc”


wcf service2

 

  • Open IHELLO.cs and remove the “void DoWork()”.

 

IHELLO.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace WcfService1
{
// NOTE: You can use the “Rename” command on the “Refactor” menu to change the interface name “IHELLO” in both code and config file together.
[ServiceContract]
public interface IHELLO
{
[OperationContract]
string sayHello();

}
}

  • Configure Endpoints with Metadata

To do this open the Web.config file. We are going to create one Endpoint with basicHttpBinding. We are adding a Endpoint also to configure the metadata of the service.

<services>
<service behaviorConfiguration=”WcfService1.HELLOBehavior” name=”WcfService1.HELLO”>
<endpoint address=”” binding=”basicHttpBinding” contract=”WcfService1.IHELLO”/>
<endpoint address=”mex” binding=”mexHttpBinding” contract=”IMetadataExchange” />
</service>
</services>

 

  • Implement Service. HELLO.svc.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace WcfService1
{

public class HELLO : IHELLO
{
public string sayHello()
{
return “Hello! welcome to WCF”;
}
}
}

Now we have created the Service and configured the Endpoint.To host it press F5 in Visual Studio.
In the browser you will see the Service as in the following. wcf service3To view the metadata of the Service click on the WSDL URL. wcf service4

 

In Windows / Web application we can consume this WCF service by using “Add Service Reference”->Add Service Address “http://localhost:57091/HELLO.svc” -> Click on Go.

I had created console application and added service reference.

Program.cs

using System;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
HelloServiceReference.HELLOClient oHell = new HelloServiceReference.HELLOClient();
string str= oHell.sayHello();
Console.WriteLine(str);
}
}
}

wcf service5

  • Press F5 to run the Console Application and we got below output.wcf service6

 

Related helpful links

https://msdn.microsoft.com/en-us/library/ms731082(v=vs.110).aspx

http://www.wcftutorial.net/

I hope this will help you.Your valuable feedback and comments are important for me.

Myth Buster for SharePoint SQL RBS

Hi All,

 

In this article I would try to share my experience about SharePoint on SQL RBS. This article may help you decide if you should use SQL RBS with SharePoint or any other product.

 

This is my personal opinion about SQL RBS with SharePoint. I would suggest you to cross check below furnished details before taking final decision. Microsoft keeps enhancing its product so some of these may be fixed\resolved\changed.

 

Let’s first discuss what is SQL RBS? Normally when you upload a document, image, video, audio, etc on your SQL server it is stored in MDF (Master database file) of your SQL content database. As per my past experience when you upload anything to a content management system, you would revisit only 20 % of data uploaded, rest 80 % of data is never visited but used for record only purpose. IT pro’s suggest that you should keep your SQL content database on RAID 10 hard disk or SAN which is pretty expensive.

 

To resolve this issue Microsoft came out with SQL RBS which allows you to store your Files\BLOB outside (File system) of SQL database. This means you can use a Raid 0 drive to store BLOB files (image, video, document, etc). RBS is intended to lower storage costs by allowing you to store large read-intensive BLOBs on less expensive drives.

 

1st Myth of SQL RBS: Additional Storage for Content database.

This is the biggest myth about SQL RBS. Microsoft Suggest that your content database should be below 200 GB. Now days when we have a USB stick with 100 GB, a Content management server restricted to 200 GB is not a good deal. To overcome this issue few IT admin plan to use SQL RBS because RBS stores files outside of SQL server hence decrease the size of content database.

Reality: RBS does not increase the storage limits of content databases. All limitations still apply to RBS-enabled content databases. If you are using Remote BLOB Storage (RBS), the total volume of remote BLOB storage and metadata in the content database must not exceed the 200GB limit.

 

2nd Myth of SQL RBS: Files stored on FILESYSTEM through RBS cannot be accessed directly.

IT Pros and lot of other articles says that we cannot open the file directly from BLOB FILESYSTEM. We have to go through SQL database in order to read these files.

Reality: I was able to access FILESYSTEM where the BLOB files were stored and was able to open my txt, bmp, jpg, etc files. SharePoint is known for its Item level Security. So far SharePoint security was never compromised and access is only available on need to know basis. If any users who has access to FILESYSTEM can open any file stored in SharePoint without having access on SharePoint is a security issue. Also encryption is not supported on BLOBs, even if Transparent Data Encryption is enabled.

 

3rd Myth of SQL RBS: Better performance I hear a lot of IT PRO who comment that they would get better performance if FILES\BLOBS are stores outside of SQL Server.

Reality: I would accept this when we are using SharePoint to store Hugh amount of data files (70-80 % of BLOB). When I asked these IT Pros how much data is stored on dbo.docs, dbo.AllDocStreams, dbo.DocStreams, dbo.AllDocVersions, dbo.alldocs, etc table, they are not aware of same or they don’t bother. When you offload 70-80 % of data from your MDF file and store it FILESYSTEM you may feel better performance. If our content database stores BLOB files not more then 30-35 % then it would not make sense to go with RBS. Let me explain you why I say that, when you configure RBS you create number of additional tables on your content database. This means when we upload BLOB to SharePoint it will execute additional query to store data. Here SQL will first import image files, and then it may split the file based on size of file and then store it to FILESYSTEM. Again this process is reversed when we try to open or query the BLOB file. This will increase disk IO, RAM and processing power. Now if consumption of my resources is increased, how can I expect better performance? RBS does not support using data compression but data is compressed when uploaded to SQL MDF file. Microsoft says “Although using RBS with files larger than 1 MB can improve I/O and processor performance, using RBS with files smaller than 256 KB might decrease overall performance. Storing the BLOBs inline in the content database is more efficient with smaller files”

 

4th Myth of SQL RBS: Ease in management

A lot of IT Pro’s also comment that it is easy to manage smaller SQL databases, Better Technology, Ease in configuration, etc.

Reality: Why you want to take an additional Load of configuration anything extra on SQL. If any feature is available does not mean you should use it. Implementation of these features depends on its pros\cons and specific requirement of the feature. Also when you backup the database, it will backup all the files from FILESYSTEM along with SQL MDF\LDF files. Sizes of these databases backup does not decreases but it increase because RBS does not perform any compression. If you plan High availability through Mirroring or Log shipping, you need to follow additional steps to configure the same.

That’s it from my side. Feel free to comment or connect with me if you feel any of the above information is incorrect.

Reference:

https://technet.microsoft.com/en-us/library/cc262787.aspx

https://technet.microsoft.com/en-us/library/ff628583.aspx

Hybrid Delve and Search are coming to SharePoint 2016 and SharePoint 2013

Hi All,

As you all know that Hybrid Delve and Search are coming to SharePoint 2016 and SharePoint 2013. Hope below additional details can be of help.

 

What is Cloud search service application?

If you plan to use Hybrid Delve and Search feature then you will have to create a Cloud Search Service Application. As far as I know key source behind Delve (Office Graph) for Delve won’t be available On Premises SharePoint.

 

How does it work?

I see a lot of concern where people ask if the crawled content would remain on Cloud server or On-premises SharePoint server. The content itself remains On-Premises and the indexed metadata is unified in a Cloud Index in Office 365. This mean crawled content resides in your environment but their index resides on Office 365 servers.

Now another concern is what happens to sensitive data which will be crawled. Its indexes would move to cloud which may not be accepted to everyone.

For sensitive content it would be recommended to not index this content using the Cloud SSA. The Combining Hybrid search approaches can use the current Query federation approach for the hybrid scenario should this need to be queried from SharePoint Online.

 

What would be an Ideal scenario if you plan to SharePoint 2016 Cloud Search Service Application?

Bill Baer says “I wouldn’t approach the new hybrid search experience as sending the entirety of your content to the unified index in SPO, just the “indexed” content, I.e. the first 100K – as related to selectively sending content to the unified index, yes, that can be achieved with the new hybrid cloud Search SA – the number of servers on-premises as related to scale-related considerations is dependent on your own throughput needs, but can be as few as a single server running either SharePoint 2013 and/or SharePoint 2016 which can serve as a proxy to legacy content sources such as SharePoint 2010. Since the index is unified in SPO and the results returned by Office 365 you can also potentially reduce the scale of your existing search architecture and let the service do the heavy lifting of storing and returning results.”

To summarize, if you have lot of content which does not contain sensitive information and your company is ready for Hybrid approach you can crawl Hugh amount of data but your search architecture would be very small because half of the load(Index and Query) would be taken by Office 365 servers. Here you will get a very good search performance even if you have single SharePoint environment.

 

What is required for Cloud search service application?

You need On-Premises SharePoint environment and Office 365 subscription to use Cloud search service application.

 

Hope this will help you with your SharePoint 2016 planning.

 

No SharePoint Foundation 2016

Hi All,

 

We all know SharePoint Designer 2013 is the last version of SharePoint Designer available to us. Now another big hit is SharePoint Foundation 2013 is also the last free version of SharePoint product available with us.

 

I just got confirmation that Microsoft would not release SharePoint Foundation 2016 along with SharePoint Server 2016. This is a big hit to companies who use SharePoint foundation in their current organization and planned to upgrade to SharePoint Foundation 2016. I very well know that a very big SharePoint market uses SharePoint Foundation because it is free and it has great features.

 

If you use SharePoint Foundation and you want Microsoft to continue SharePoint Foundation product, you can tweet @williambaer or email him at wbaer@microsoft.com. That’s your only chance where you need to show Microsoft how you use SharePoint foundation, how does it benefit you and why Microsoft should continue this product line

 

Hope this will help you with your SharePoint 2016 planning.

Keyword Query text limit in SharePoint Search

Hi All,

I was recently asked if we have any limit for Query text we use to perform search in SharePoint.

After some research I found that the length limit of a KQL query varies depending on how you create it. If you create the KQL query by using the default SharePoint search front end, the length limit is 2,048 characters. However, KQL queries you create programmatically by using the Query object model have a default length limit of 4,096 characters. You can increase this limit up to 20,480 characters by using the MaxKeywordQueryTextLength property or the DiscoveryMaxKeywordQueryTextLength property (for eDiscovery).

Again the length of FAST Query Language queries is limited to 2,048 characters.

This applies to SharePoint 2010, 2013

Reference : https://msdn.microsoft.com/en-us/library/office/ee558911.aspx

Note: You cannot modify this value in Office 365 SharePoint site

 

SharePoint “Add to timeline” option is disabled\Grayed out on Project site

 

Hi All,

Recently I found a issue where “Add to timeline” option is disabled on Project site.

After some research I found that in order to do enable “Add to timeline”, the user must have the permission to “manage” list, the contribution is not enough!

A user with contributor permission will see the option grayed out and won’t be able to use it.

Hope this will be helpful

Prepare Seeds for Tree plantation

Hi All,

Today we will understand how we can prepare some dry seeds in case we wish to plant trees.

We will 1st collect seeds from different fruits and vegetables. I collected some orange seeds as shown below:

tree1

Now we will wash it properly. Motive is to make sure seeds don’t carry any pulp or it might have fungus on it. Check the image below:

tree2

Once we wash the seeds, we will dry them using some napkin or cloth and keep it under sunlight for a day or 2. Seeds must be carefully dried and then stored under the proper conditions in order to give them the best chances of germinating and producing healthy plants when they are planted.

tree3

Dry your seeds thoroughly before storing them. If seeds sweat on insides of jars during storage, they are too wet and must be dried further in order to store successfully.

 

Thanks everyone for helping us save planet.

SharePoint : Redirect to different home page for authenticated users

Hi All,

Today I got a requirement where authenticated users should be redirected to a different page, here is how I achieved it.

Editing the exiting SharePoint Landing page, then add a new content editor Web Part on the page. Now edit the content editor webpart and click on Web part properties on top. Now select “Embed code” under Insert for content editor webpart, add below script in :


<meta http-equiv=”refresh” content=”5;url=http://sharepoint/SitePages/Home.aspx”>


Try to check if your site is redirect to the new site.

If the redirection is working fine then we will restrict this script only for authenticated users. We need to edit the page again and select Edit webpart. Under Advance setting Set Target Audience as “NT Authenticated users”

Hope this helps you.

openfire installation on Centos 6.6

Hello Everyone,

Today we are installing openfire server on centos

what is openfire is opensource IM server means it’s best alternative for MS lync, you can also enable voice chat in openfire for that you have to install require plug inns.

& again best things for openfire is it’s FREE….

So here we start openfire installation

Login to the server as root This installs the dependencies:

yum -y install wget java glibc.i686

download RPM from

wget http://download.igniterealtime.org/openfire/openfire-3.8.1-1.i386.rpm

 

Run & installed the RPM

Yum –y install openfire-3.8.1-1.i386.rpm

 

Now start the openfire service

service openfire start

chkconfig  openfire on

 

now stop the iptable for time being

service iptables stop

 

Install mysql server

yum -y install mysql-server

 

now start the mysql service

service mysqld start

chkconfig mysqld on

 

mysql secure installation

mysql_secure_installation

 

 

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL

      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we’ll need the current

password for the root user.  If you’ve just installed MySQL, and

you haven’t set the root password yet, the password will be blank,

so you should just press enter here.

Enter current password for root (enter for none):

OK, successfully used password, moving on…

Setting the root password ensures that nobody can log into the MySQL

root user without the proper authorisation.

 

Set root password? [Y/n] y

New password:

Re-enter new password:

Password updated successfully!

Reloading privilege tables..

 … Success! ………………………………………………………………………………………………………………………………………..

……………………………………………………………………………………………………………………………………………………………..

…………………………………………………………………………………………………………………………………………………………………………….

 

 

Now Restart mysql server

service mysqld restart

 

Now log in to the mysql with root username & password , create a database named “openfire”

mysql -u root –p

 

create a database openfire

mysql> CREATE DATABASE openfire;

 

mysql> CREATE USER ‘fire’@’localhost’ IDENTIFIED BY ‘root123’;

Query OK, 0 rows affected (0.00 sec)

 

mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP

    -> ON openfire.*

    -> TO ‘fire’@’localhost’;

Query OK, 0 rows affected (0.00 sec)

 

mysql> FLUSH PRIVILEGES;

Query OK, 0 rows affected (0.00 sec)

 

mysql>exit

 

Service iptables stop

Or

 

You can add below ports in iptables

-A INPUT -m state –state NEW -m tcp -p tcp –dport 9090 -j ACCEPT

-A INPUT -m state –state NEW -m tcp -p tcp –dport 5222 -j ACCEPT

-A INPUT -m state –state NEW -m tcp -p tcp –dport 5223 -j ACCEPT

-A INPUT -m state –state NEW -m tcp -p tcp –dport 9091 -j ACCEPT

-A INPUT -m state –state NEW -m tcp -p tcp –dport 7777 -j ACCEPT

-A INPUT -m state –state NEW -m tcp -p tcp –dport 7070 -j ACCEPT

-A INPUT -m state –state NEW -m tcp -p tcp –dport 7443 -j ACCEPT

-A INPUT -m state –state NEW -m tcp -p tcp –dport 5229 -j ACCEPT

-A INPUT -j REJECT –reject-with icmp-host-prohibited

 

[root@openfire ~]# service iptables restart

iptables: Setting chains to policy ACCEPT: filter          [  OK  ]

iptables: Flushing firewall rules:                         [  OK  ]

iptables: Unloading modules:                               [  OK  ]

iptables: Applying firewall rules:                         [  OK  ]

 

Open_insta1

 

 

Open_insta2

Open_insta3 Open_insta4 Open_insta5 Open_insta6

 

http://hostname:9090/login.jsp

 

log in to the server as

admin

default password “admin”

 

I have created user named “Sachin” & “paresh”

 

Open_insta7

 

Install Spark messenger on your desktop

 

 

Downlod link for spark IM

http://www.igniterealtime.org/downloads/

 

Open_insta8

 

 

 

It’s

Done

 

–Sachin