Archive

Archive for the ‘Trouble Shooting’ Category

This file cannot be saved to this location because there is no connection

August 28th, 2009 Dominick Cosgrove No comments

If you are using a VPC with no network connectivity, (i.e. your LAN or Wireless network is not available to the VPC) and you try to save a document to a SharePoint Document library you get the following error message

“This file cannot be saved to this location because there is no connection to the server. Check your network connection and try again.”

image

This issue is cause System Event Notification Service.

Purpose

Applications designed for use by mobile users require a unique set of connectivity functions and notifications. In the past these individual applications were required to implement these features internally. The System Event Notification Service (SENS) now provides these capabilities in the operating system, creating a uniform connectivity and notification interface for applications. Using SENS developers can determine connection bandwidth and latency information from within their application and optimize the application’s operation based on those conditions.

Where Applicable

The connectivity functions and notifications of SENS are useful for applications written for mobile computers or computers connected to high latency local area networks.

Solution

Office applications use the System Event Notification Service to ensure that the required connection is available during the save process. As the service determines that there is no network connection available it causes the save to fail. To prevent this you need to stop this service. The easiest way to do this is to use the following command:

net stop sens

image

To restart the service issue the following command:

net start sens

image

Note: The service is set to start automatically by default in Windows, so you will get the error again after a reboot of the VPC. To prevent this you can set the service to start manually:

image

SPDisposeCheck

March 2nd, 2009 Dominick Cosgrove No comments

Every SharePoint Developer should have SPDisposeCheck Tool in there arsnel! This tool, developed by the guys on the SharePoint Team will intergoate your compiled .dll’s to ensure that you are correctly disposing of SharePoint objects, primarily SPSite and SPWeb. Why do we need to dispose of SharePoint object, well from the horses mouth as such :

“Several of the Windows SharePoint Services objects, primarily the SPSite class and SPWeb class objects, are created as managed objects. However, these objects use unmanaged code and memory to perform the majority of their work. The managed part of the object is much smaller than the unmanaged part. Because the smaller managed part does not put memory pressure on the garbage collector, the garbage collector does not release the object from memory in a timely manner. The object’s use of a large amount of unmanaged memory can cause some of the unusual behaviors described earlier. Calling applications that work with IDisposable objects in Windows SharePoint Services must dispose of the objects when the applications finish using them. You should not rely on the garbage collector to release them from memory automatically.”

Roger Lamb has an excellent blog article - SharePoint 2007 and WSS 3.0 Dispose Patterns by Example

Add SPDisposeCheck to Visual Studio

Visual Studio IDE allows you to add External Tools such as SPDisposeCheck. The follow steps explain how:

1. In Visual Studio select Tools | External Tools

2. Add the following settings:

Title:  SPDisposeCheck
Command: C:\Program Files\Microsoft\SharePoint Dispose Check\SPDisposeCheck.exe
Arguements: $(TargetName)$(TargetExt)
Initial Directory: $(TargetDir)
Use Output Window: Checked

SP Dispose Check External Tools

SP Dispose Check External Tools

Reference

Introduction to Using Disposable Windows SharePoint Services Objects