Visual Studio 2010 started behaving weird suddenly. It would zoom the text when using the mouse wheel. Could'nt find the option to disable it. Stumbled across this article and now I know that pressing Ctrl disables it.
http://visualstudiogallery.msdn.microsoft.com/d088791c-150a-4834-8f28-462696a82bb8/
Pressing Ctrl followed by mouse wheel move enables it in the IDE.
Wednesday, May 30, 2012
WCF Timeout Issues
When I first converted my SharePoint Webpart to use the locally deployed WCF service, no compile errors occured.
However, when I deployed the webpart and started testing, timeouts were occuring and the page was not responding.
Researched this and found the following information useful. http://stackoverflow.com/questions/981475/wcf-timeout-exception-detailed-investigation
This is what I did:
1)On the Sharepoint Web.config file on my development server: Set the following: maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" Also, in the clientcode(webpart code) did the following:
2) Set the following in In Page_load: //This says how many outgoing connection you can make to a single endpoint. Default Value is 2 System.Net.ServicePointManager.DefaultConnectionLimit = 200;
3)Made sure all the WCF client objects are closed in a finally block after the WCF calls are made. Even in cases where Channels were used, closed the channel in the finally after the WCF service call was made.
The close channel has the following code where _wcfAccess is the channel created.
if (_wcfAccess != null) { ((IClientChannel)_wcfAccess).Close(); ((IDisposable)_wcfAccess).Dispose(); _wcfAccess = null; }
Inspite of having all the above in place, I ran in to an issue where my web page froze up for an indefinite period of time.The page had a call to a WCF service that should return a record. I saw the "Server too busy" exception in the diagnostics log when the above happened.
I researched and stumbled on this thread. http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/745b95d2-1480-4618-89f5-1339d6ee228d/ I was going to try the above, when I found out the below. It turns out that there was a bug in the Database code that it was returning multiple records or a Dataset instead of one record.
The WCF call then took forever to finish receiving this and the Receive Timeout on the Binding Element for the WCF contract in question was set to 10 minutes(by default) and so the page froze up for this long.
However, when I deployed the webpart and started testing, timeouts were occuring and the page was not responding.
Researched this and found the following information useful. http://stackoverflow.com/questions/981475/wcf-timeout-exception-detailed-investigation
This is what I did:
1)On the Sharepoint Web.config file on my development server: Set the following: maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" Also, in the clientcode(webpart code) did the following:
2) Set the following in In Page_load: //This says how many outgoing connection you can make to a single endpoint. Default Value is 2 System.Net.ServicePointManager.DefaultConnectionLimit = 200;
3)Made sure all the WCF client objects are closed in a finally block after the WCF calls are made. Even in cases where Channels were used, closed the channel in the finally after the WCF service call was made.
The close channel has the following code where _wcfAccess is the channel created.
if (_wcfAccess != null) { ((IClientChannel)_wcfAccess).Close(); ((IDisposable)_wcfAccess).Dispose(); _wcfAccess = null; }
Inspite of having all the above in place, I ran in to an issue where my web page froze up for an indefinite period of time.The page had a call to a WCF service that should return a record. I saw the "Server too busy" exception in the diagnostics log when the above happened.
I researched and stumbled on this thread. http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/745b95d2-1480-4618-89f5-1339d6ee228d/ I was going to try the above, when I found out the below. It turns out that there was a bug in the Database code that it was returning multiple records or a Dataset instead of one record.
The WCF call then took forever to finish receiving this and the Receive Timeout on the Binding Element for the WCF contract in question was set to 10 minutes(by default) and so the page froze up for this long.
Ajax Update Panel and Required Field Validators
Ran in to an issue this morning, where the cancel button's causesvalidation="false" property was not functioning correctly.
Basically the whole page froze up if the validation failed. This(validator) was inside a formView inside an Update Panel on a Sharepoint WebPart. Researched and found this, which gave me pointers to try.
http://www.codeproject.com/KB/ajax/UpdatePanel_Validation.aspx
Finally, adding EnableClientScript="false" to the Required Field validator made the cancel button work properly.
Basically the whole page froze up if the validation failed. This(validator) was inside a formView inside an Update Panel on a Sharepoint WebPart. Researched and found this, which gave me pointers to try.
http://www.codeproject.com/KB/ajax/UpdatePanel_Validation.aspx
Finally, adding EnableClientScript="false" to the Required Field validator made the cancel button work properly.
Enable Debugging in SharePoint
In WSS 3.0/MOSS 2007 to enable debug information we have to modify only the web.config related to your web application.
Instead, in SharePoint 2010, we have to modify two different web.config files:
1.the one that you can find in the root directory of the web application in which you want to debug you customizations (the file at the path: [drive]:\inetpub\wwwroot\wss\virtualdirectories\[port])
2.the one that you can find into the "LAYOUTS" directory under the SharePoint root (the file at the path: [drive]:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS)
What remains unchanged from the previous version of SharePoint are the number of attribute to change in the web.config file:
•The "debug" attribute of the "compilation" element has to be set to "true"
•The "callstack" attribute of the "safemode" element has to be set to "true"
•The "mode" attribute of the "customerrors" element has to be set to "off"
This is from this site: http://www.dev4side.com/community/blog/2010/8/16/how-to-enable-debug-information-over-exceptions-on-sharepoint-2010.aspx
Instead, in SharePoint 2010, we have to modify two different web.config files:
1.the one that you can find in the root directory of the web application in which you want to debug you customizations (the file at the path: [drive]:\inetpub\wwwroot\wss\virtualdirectories\[port])
2.the one that you can find into the "LAYOUTS" directory under the SharePoint root (the file at the path: [drive]:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS)
What remains unchanged from the previous version of SharePoint are the number of attribute to change in the web.config file:
•The "debug" attribute of the "compilation" element has to be set to "true"
•The "callstack" attribute of the "safemode" element has to be set to "true"
•The "mode" attribute of the "customerrors" element has to be set to "off"
This is from this site: http://www.dev4side.com/community/blog/2010/8/16/how-to-enable-debug-information-over-exceptions-on-sharepoint-2010.aspx
Enable SessionState in Sharepoint
1) Open SharePoint 2010 Management Shell (As Administrator) and type the following command:
Enable-SPSessionStateService –DefaultProvision.
2) To resolve the error and to enable session state for SharePoint there are two entries that need to exist in the web.config file.
The first is to ensure that enableSessionState is set to TRUE.
...<..pages enableSessionState="true" enableViewState="true" enableViewStateMac="true" validateRequest="false" pageParserFilterType="Microsoft.SharePoint.ApplicationRuntime.SPPageParserFilter, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" asyncTimeout="7"..>..
The second is to ensure that the remove and add lines exist in the modules section for Session.
..<..modules runAllManagedModulesForAllRequests="true"..>.. …
.<.remove name="Session" ./>. .<.add name="Session" type="System.Web.SessionState.SessionStateModule" preCondition="" ./>. … modules>
ALSO,Additional steps to ensure the "web.config"
1.Add to the configuration/system.webServer/modules element.
2.Set the enableSessionState attribute of the configuration/system.web/pages element to true.
3.Add to the configuration/system.web element
3) Reset IIS.
Enable-SPSessionStateService –DefaultProvision.
2) To resolve the error and to enable session state for SharePoint there are two entries that need to exist in the web.config file.
The first is to ensure that enableSessionState is set to TRUE.
...<..pages enableSessionState="true" enableViewState="true" enableViewStateMac="true" validateRequest="false" pageParserFilterType="Microsoft.SharePoint.ApplicationRuntime.SPPageParserFilter, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" asyncTimeout="7"..>..
The second is to ensure that the remove and add lines exist in the modules section for Session.
..<..modules runAllManagedModulesForAllRequests="true"..>.. …
.<.remove name="Session" ./>. .<.add name="Session" type="System.Web.SessionState.SessionStateModule" preCondition="" ./>. … modules>
ALSO,Additional steps to ensure the "web.config"
1.Add
Enable Diagnostics in WCF service
Add these entries to the web.config file of the WCF service site(application) in question.
Consume the service. After the operation is complete or errors out, open the log file at the above specified location on the machine hosting the service to see the issue.
]] Comment this section when not in use to make sure it does not affect performance.
Also, make sure you set the includeExceptionDetailInFaults attribute to true in the WCF config file to see the root error.
Consume the service. After the operation is complete or errors out, open the log file at the above specified location on the machine hosting the service to see the issue.
]] Comment this section when not in use to make sure it does not affect performance.
Also, make sure you set the includeExceptionDetailInFaults attribute to true in the WCF config file to see the root error.
Javascript Error
http://sympmarc.com/2010/08/28/how-to-fix-sys-argumenttypeexception-object-of-type-sys-_application-cannot-be-converted-to-type-sys-_application-error/
Microsoft JScript runtime error: Object expected
It turns out I was missing a curly brace in Javascript. This post saved me lots of time.
http://social.msdn.microsoft.com/Forums/en-US/netfxjscript/thread/eede0ba6-1e1d-4248-98bb-6383839dfac7/
Raising Javascript Event in ASP.NET user control
Raising Javascript Event in ASP.NET user control
http://stackoverflow.com/questions/389450/raising-javascript-events-in-asp-net-user-control
Server Side Method()
{
Server side code...
this.Controls.Add(new LiteralControl(""));
}
This will execute the server side code and print the document next. We can even call this at the beginning/end of Page_load or after some server code is executed.
WCF Service Troubleshooting
WCF Service Troubleshooting tips
http://www.infosysblogs.com/microoft/2009/06/troubleshooting_wcf_service_ap.html
http://msdn.microsoft.com/en-us/library/ms731055.aspx
http://stackoverflow.com/questions/399847/net-memory-profiling-tools
http://www.infosysblogs.com/microoft/2009/06/troubleshooting_wcf_service_ap.html
http://msdn.microsoft.com/en-us/library/ms731055.aspx
http://stackoverflow.com/questions/399847/net-memory-profiling-tools
Subscribe to:
Posts (Atom)