Sladescross's Blog

Blogging about Sharepoint related stuff

ASP.NET Tracing November 18, 2013

Filed under: Response.Write,Trace,Tracing — sladescross @ 10:16 pm

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

Obviously the Add() method is being called. However, unlike the Repsonse.Write() statements, the Trace.Write() statements do not appear within the resulting output. To view the results of the Trace.Write() statements, we need to enable tracing for this page or for the application.

To enable tracing, we can use either a page directive or a configuration option. Let’s look at both.

http://msdn.microsoft.com/en-us/library/bb386420(v=vs.100).aspx

Viewing Trace Information

You can view trace information at the bottom of individual pages. Alternatively, you can use the trace viewer (Trace.axd) to view trace information that is collected and cached by ASP.NET when tracing is enabled. For details about what the trace display includes, see Reading ASP.NET Trace Information later in this topic.

 

 

 

 

ASP.NET Page Life Cycle Ajax and Controls

http://msdn.microsoft.com/en-us/library/ms178472.ASPX

When an ASP.NET page runs, the page goes through a life cycle in which it performs a series of processing steps. These include initialization, instantiating controls, restoring and maintaining state, running event handler code, and rendering. It is important for you to understand the page life cycle so that you can write code at the appropriate life-cycle stage for the effect you intend.

If you develop custom controls, you must be familiar with the page life cycle in order to correctly initialize controls, populate control properties with view-state data, and run control behavior code. The life cycle of a control is based on the page life cycle, and the page raises many of the events that you need to handle in a custom control.

http://msdn.microsoft.com/en-us/library/bb386573(v=vs.100).aspx

Partial-page rendering removes the need for the whole page to be refreshed as the result of a postback. Instead, only individual regions of the page that have changed are updated. As a result, users do not see the whole page reload with every postback, which makes user interaction with the Web page more seamless. ASP.NET enables you to add partial-page rendering to new or existing ASP.NET Web pages without writing client script.

http://msdn.microsoft.com/en-us/library/bb398817(v=vs.100).aspx

Debugging and tracing AJAX applications.

Configuring Internet Explorer for Debugging

By default, Internet Explorer ignores problems that it encounters in JavaScript. You can enable debugging by using the following procedure.

To enable debugging in Internet Explorer

  1. In the Tools menu, click Internet Options.
  2. In the Advanced tab, clear the Disable Script Debugging (Internet Explorer) check box and the Disable Script Debugging (Other) check box.
  3. Select the Display a notification about every script error check box.
  4. To turn off “friendly” error messages, clear the Show friendly HTTP error messages check box.If “friendly” error message are enabled and if an HTTP 500 error response from the server is less than 513 bytes long, Internet Explorer masks the content. In place of the error information, Internet Explorer displays a message that is meant for end users, not developers.

Attaching the Visual Studio Debugger to Internet Explorer

To debug client script, you must attach a debugger to Internet Explorer. In Visual Studio, if you start your application for debugging (by pressing F5 or using the Start Debugging command in the Debug menu), the debugger is attached automatically.

You can also attach the Visual Studio debugger to Internet Explorer when the application is already running. To do so, in the Debug menu, click Attach to Process…. In the Attach to Process dialog box, select the instance of Internet Explorer (iexplore.exe) that you want to attach the debugger to.

NoteNote
If Internet Explorer is configured for debugging, the Type column for the relevant instance of Internet Explorer displays Script, x86. If you see only x86 in the Type column, make sure that Internet Explorer is configured for debugging.

If Internet Explorer encounters a script error and is configured for script debugging, but it is not currently attached to a debugger, the browser prompts you to select a debugger. You can either continue without debugging or attach a debugger and step through the code.

http://msdn.microsoft.com/en-us/library/aa310918(v=vs.71).aspx

The following list describes typical scenarios in which you are likely to develop your own controls and provides links to other topics for further information.

  • You have created an ASP.NET page that provides a user interface that you want to reuse in another application. You want to create a server control that encapsulates the user interface (UI) but do not want to write additional code. ASP.NET allows you to save your page as a user control without writing a single additional line of code. For details, see Web Forms User Controls.
  • You want to develop a compiled control that combines the functionality of two or more existing controls. For example, you need a control that encapsulates a button and a text box. You can do this using control composition, as described in Developing a Composite Control.
  • An existing ASP.NET server control almost meets your requirements but lacks some required features. You can customize an existing control by deriving from it and overriding its properties, methods, or events.
  • None of the existing ASP.NET server controls (or their combinations) meet your requirements. In that case, you can create a custom control by deriving from one of the base control classes. These classes provide all the plumbing needed by an ASP.NET server control, thus allowing you to focus on programming the features you need. To get started, see Developing Custom Controls: Key Concepts and Developing a Simple ASP.NET Server Control.

Many custom controls involve a combination of scenarios, where you combine existing ASP.NET server controls with custom controls that you have designed.

Note   The authoring paradigm outlined in the first bullet (user controls) is very different from that for the other scenarios. User controls are written using the same programming model as ASP.NET pages, and they are ideal for rapid control development. The other scenarios involve object-oriented programming in languages that target the common language runtime, such as Visual Basic .NET and C#. A user control is saved as an .ascx page, which is a text file, while the other scenarios create controls that are compiled and persisted in assemblies. For a summary of differences, see Composite Control vs. User Control.

 

 

Developing Using Event Reporting and Tracing August 7, 2013

Filed under: Event,Event Logging,Logging,New,Trace,Tracing — sladescross @ 9:50 pm

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

 

SharePoint WCF Tracing February 20, 2013

Filed under: Sharepoint,Tracing,WCF — sladescross @ 10:24 pm

http://blogs.msdn.com/b/sridhara/archive/2010/04/06/tracing-sharepoint-2010-service-applications.aspx

 

System.Net Tracing and SharePoint Crawl September 2, 2012

Filed under: Crawl Tracing,System.Net,Timer Tracing,Tracing — sladescross @ 6:01 pm

http://support.microsoft.com/kb/947285

Scenario 2: Troubleshooting search and crawl issues

When you troubleshoot search and crawl issues, you may receive one or both of the following error messages  in the Crawl log:

Crawling this document could not be completed because the remote server did not respond within the specified timeout. Try crawling the server later, or increase the timeout value. You may also try scheduling crawls during off-peak usage times.
An unrecognized HTTP status was received.  Check that the address can be accessed using Internet Explorer.
How to enable System.NET tracing for the Windows SharePoint Services Timer service
To enable System.NET tracing for the Windows SharePoint Services Timer service, follow these steps:

  1. Create a text file that is named Owstimer.exe.config in the following folder:
    %CommonProgramFiles%\Microsoft Shared\web server extensions\12\BIN
  2. In the Owstimer.exe.config text file, paste the following XML data.

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

<configuration>
<system.diagnostics>
<sources>
<source name=”System.Net” tracemode=”includehex” maxdatasize=”1024″>
<listeners>
<add name=”System.Net”/>
</listeners>
</source>
<source name=”System.Net.Sockets”>
<listeners>
<add name=”System.Net”/>
</listeners>
</source>
<source name=”System.Net.Cache”>
<listeners>
<add name=”System.Net”/>
</listeners>
</source>
</sources>
<switches>
<add name=”System.Net” value=”Verbose”/>
<add name=”System.Net.Sockets” value=”Verbose”/>
<add name=”System.Net.Cache” value=”Verbose”/>
</switches>
<sharedListeners>
<add name=”System.Net”
type=”System.Diagnostics.TextWriterTraceListener”
initializeData=”network.log”
/>
</sharedListeners>
<trace autoflush=”true”/>
</system.diagnostics>
</configuration>

System.Net configuration for network tracing.

 

Service Tracing and Message Logging

Filed under: Logging,Message Logging,Tracing — sladescross @ 5:31 pm

http://msdn.microsoft.com/en-us/library/ms730064(v=vs.100).aspx

Message Logging

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

Tracing and Message Logging.

http://blogs.msdn.com/b/dgorti/archive/2005/09/18/471003.aspx

System.Net tracing.

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

traces and message logs are viewed using the Service Trace Viewer Tool (SvcTraceViewer.exe).

 

System.Net Tracing February 13, 2012

Filed under: System.NET Tracing,Tracing,WPF Tracing — sladescross @ 9:23 pm

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

asmx tracing.

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

WCF tracing

<system.diagnostics>

<sources>

<source name=”System.Net” tracemode=”includehex” maxdatasize=”1024″>

<listeners>

<add name=”System.Net”/>

</listeners>

</source>

<source name=”System.Net.Sockets”>

<listeners>

<add name=”System.Net”/>

</listeners>

</source>

<source name=”System.Net.Cache”>

<listeners>

<add name=”System.Net”/>

</listeners>

</source>

<source name=”System.ServiceModel.MessageLogging” switchValue=”Warning, ActivityTracing, Verbose” >

<listeners><add name=”ServiceModelTraceListener”/>

</listeners>

</source>

<source name=”System.ServiceModel” switchValue=”Warning,ActivityTracing”>

<listeners>

<add name=”ServiceModelTraceListener”/>

</listeners>

</source>

<source name=”System.Runtime.Serialization” switchValue=”Warning,ActivityTracing”>

<listeners>

<add name=”ServiceModelTraceListener”/>

</listeners>

</source>

<source name=”System.Web.Services.Asmx”>

<listeners>

<add name=”AsmxTraceFile” type=”System.Diagnostics.TextWriterTraceListener” initializeData=”C:\temp\asmx.log” traceOutputOptions=”LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId” />

</listeners>

</source>

</sources>

<switches>

<add name=”System.Net” value=”Verbose”/>

<add name=”System.Net.Sockets” value=”Verbose”/>

<add name=”System.Net.Cache” value=”Verbose”/>

<add name=”System.Web.Services.Asmx” value=”Verbose”  />

</switches>

<sharedListeners>

<add name=”System.Net” type=”System.Diagnostics.TextWriterTraceListener” initializeData=”C:\temp\network.log”/>

<add initializeData=”C:\temp\wpf.svclog” type=”System.Diagnostics.XmlWriterTraceListener” name=”ServiceModelTraceListener” traceOutputOptions=”Timestamp”/>

</sharedListeners>

<trace autoflush=”true”/>

</system.diagnostics>

<system.net>

<defaultProxy>

<proxy usesystemdefault=”False” bypassonlocal=”True” proxyaddress=”http://127.0.0.1:8888“/>

</defaultProxy>

</system.net>

http://mkdot.net/blogs/dejan/archive/2008/10/23/wcf-tracing-and-message-logging.aspx

And to get message details logged as well then need an additional node.

<configuration> <system.serviceModel> <diagnostics> <messageLogging logEntireMessage=”true” logMalformedMessages=”true” logMessagesAtServiceLevel=”true” logMessagesAtTransportLevel=”true” maxMessagesToLog =”1000″ maxSizeOfMessageToLog=”524288″/> </diagnostics>

http://stevenhollidge.blogspot.com/2011/03/how-to-enable-tracing-for-wcf-service.html

Generate the required WPF trace entries in web.config by using Visual Studio project.

<system.diagnostics> <sources> <source name=”System.Net” tracemode=”includehex” maxdatasize=”1024″> <listeners> <add name=”System.Net”/> </listeners> </source> <source name=”System.Net.Sockets”> <listeners> <add name=”System.Net”/> </listeners> </source> <source name=”System.Net.Cache”> <listeners> <add name=”System.Net”/> </listeners> </source> <source name=”System.ServiceModel.MessageLogging” switchValue=”Warning, ActivityTracing”> <listeners> <add type=”System.Diagnostics.DefaultTraceListener” name=”Default”> <filter type=”” /> </add> <add name=”ServiceModelMessageLoggingListener”> <filter type=”” /> </add> </listeners> </source> <source name=”System.ServiceModel” switchValue=”Warning,ActivityTracing”> <listeners> <add name=”ServiceModelTraceListener”/> </listeners> </source> <source name=”System.Runtime.Serialization” switchValue=”Warning,ActivityTracing”> <listeners> <add name=”ServiceModelTraceListener”/> </listeners> </source> </sources> <switches> <add name=”System.Net” value=”Verbose”/> <add name=”System.Net.Sockets” value=”Verbose”/> <add name=”System.Net.Cache” value=”Verbose”/> </switches> <sharedListeners> <add name=”System.Net” type=”System.Diagnostics.TextWriterTraceListener” initializeData=”C:\temp\network.log”/> <add initializeData=”C:\temp\searchservice.svclog” type=”System.Diagnostics.XmlWriterTraceListener” name=”ServiceModelTraceListener” traceOutputOptions=”Timestamp”/> <add initializeData=”c:\temp\app_messages.svclog” type=”System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ name=”ServiceModelMessageLoggingListener” traceOutputOptions=”Timestamp”/> </sharedListeners> <trace autoflush=”true”/> </system.diagnostics>   <system.net>     <defaultProxy>       <proxy               usesystemdefault=”False”               bypassonlocal=”True”               proxyaddress=”http://127.0.0.1:8888″/>     </defaultProxy>   </system.net> </configuration>

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

Walk through of WCF tracing. With screenshots. To explain the output.

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

Tracing web.config entries.

 

Remote Access Alternatives Using SharePoint January 29, 2012

http://blogs.msdn.com/b/stcheng/archive/2008/12/17/wss-use-rpc-protocol-to-access-wss-v3-site.aspx

RPC examples.

Trace SharePoint Designer

http://sharepointinterface.com/2009/12/28/sharepoint-webdav-and-a-case-of-the-405-status-codes/

Interesting problem with WebDav calls not working because IIS7 had web dav publishing enabled.

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=17481#instructions

GetUsage BLOB RPC call.

http://sharepointfieldnotes.blogspot.com/2009/09/uploading-content-into-sharepoint-let.html

(1) Copy.asmx file upload.

Byte array can have contiguous memory allocation problems on the server.

(2) WebDav (WebClient) file upload

No metadata can be uploaded.

(3) RPC (FrontPage) file upload

However, it does not support sending any metadata long with the file content. This can be a major problem if the document library has multiple content types, so the new file will be put into the document library with the default content type. Another big issue is if the default content type has required fields. The file will remain checked out until the fields are populated. This prevents other users from seeing the document or from being returned in any searches.  It is a great solution if you are just bulk migrating data from an external data store to SharePoint. You more than likely will have to do extra work afterwards. Adding metadata after uploading will also cause the creation of extra versions of the document being created unnecessarily. The fact that it does not use the soap protocol but straight http makes it more scalable than the copy web service. Unfortunately, it still suffers from the fact that it uses a byte array to upload the file. So sooner or later you will run into “out of memory “ exceptions.  So how can I create a folder before using WebDav?  You can use the lists web service to accomplish this:

 

WCF Debugging September 25, 2011

Filed under: System.NET Tracing,Tracing,WCF Debugging Tracing — sladescross @ 2:57 pm

http://support.microsoft.com/kb/947285

How to enable System.NET tracing for the Office SharePoint Server Search service

// To enable System.NET tracing for the Office SharePoint Server Search service (OSearch), follow these steps:

  1. Create a text file that is named Mssdmn.exe.config in the following folder:
    %ProgramFiles%\Microsoft Office Servers\12.0\Bin

    The contents of the Mssdmn.exe.config file are the same as the example of the Owstimer.exe.config, except for the initializeDataattribute. Rename this attribute to create a log file name that is specific to the Mssdmn.exe process, as in the following example.

    initializeData="C:\\Tracing\\MSSDMN_SNtrace.log"
  2. Restart the Office SharePoint Server Search service. To do this, either use the Services MMC snap-in or type the following command in a Command Prompt window:
    net stop osearch & net start osearch

http://blogs.msdn.com/b/asiatech/archive/2009/04/08/using-system-net-trace-to-troubleshooting-ssl-problem-in-net-2-0-application.aspx

<system.diagnostics>

<sources>

<source name=”System.Net” tracemode=”includehex” maxdatasize=”1024″>

<listeners>

<add name=”System.Net”/>

</listeners>

</source>

<source name=”System.Net.Sockets”>

<listeners>

<add name=”System.Net”/>

</listeners>

</source>

<source name=”System.Net.Cache”>

<listeners>

<add name=”System.Net”/>

</listeners>

</source>

</sources>

<switches>

<add name=”System.Net” value=”Verbose”/>

<add name=”System.Net.Sockets” value=”Verbose”/>

<add name=”System.Net.Cache” value=”Verbose”/>

</switches>

<sharedListeners>

<add name=”System.Net”

type=”System.Diagnostics.TextWriterTraceListener”

initializeData=”d:\temp\network.log”    />

</sharedListeners>

<trace autoflush=”true”/>

</system.diagnostics>

http://www.3guysonsharepoint.com/?p=240

<system.diagnostics> <sources> <source name="System.ServiceModel.MessageLogging" switchValue="Warning, ActivityTracing" > <listeners><add name="ServiceModelTraceListener"/> </listeners> </source> <source name="System.ServiceModel" switchValue="Warning,ActivityTracing"> <listeners> <add name="ServiceModelTraceListener"/> </listeners> </source> <source name="System.Runtime.Serialization" switchValue="Warning,ActivityTracing"> <listeners> <add name="ServiceModelTraceListener"/> </listeners> </source> </sources> <sharedListeners> <add initializeData="C:\temp\searchservice.svclog" type="System.Diagnostics.XmlWriterTraceListener" name="ServiceModelTraceListener" traceOutputOptions="Timestamp"/> </sharedListeners> </system.diagnostics>
<system.diagnostics><sources> <source name=”System.Net” tracemode=”includehex” maxdatasize=”1024″> <listeners> <add name=”System.Net”/> </listeners> </source> <source name=”System.Net.Sockets”> <listeners> <add name=”System.Net”/> </listeners> </source> <source name=”System.Net.Cache”> <listeners> <add name=”System.Net”/> </listeners> </source> </sources> <switches> <add name=”System.Net” value=”Verbose”/> <add name=”System.Net.Sockets” value=”Verbose”/> <add name=”System.Net.Cache” value=”Verbose”/> </switches> <sharedListeners> <add name=”System.Net” type=”System.Diagnostics.TextWriterTraceListener” initializeData=”d:\temp\network.log”/> </sharedListeners> <trace autoflush=”true”/></system.diagnostics>
Open the web.config file for our application (this will be found at C:\inetpub\wwwroot\wss\VirtualDirectories\80\web.config if the application is the first application running on port 80).
 

Tracing for Business Connectivity Services August 31, 2011

Filed under: Business Connectivity Services,Tracing — sladescross @ 9:50 am

http://technet.microsoft.com/en-us/library/ff700209.aspx

Enable Business Connectivity Services tracing

To enable Microsoft Business Connectivity Services tracing you create a custom data collector set, specify the trace providers that are related to Microsoft Business Connectivity Services, and provide the location for saving the trace logs.

 

 

 
Follow

Get every new post delivered to your Inbox.

Join 63 other followers