Point Deep

Mundeep's Tech Blog

Posts Tagged ‘visual studio’

Sharepoint 2010 Remote Debugging

Posted by mundeep on August 5, 2011

The following is a realy good article about Remote Debugging Sharepoint 2010 webparts and worth a read if you are ever having trouble getting it working:
http://lemonharpy.wordpress.com/2011/03/17/remote-debugging-sharepoint-2010-solutions/

Essentially the main things to ensure are:

  1. You are running Visual Sudio Remote Debugger (msvsmon.exe)
  2. You are using an account with permissions to debug.
  3. You have placed the pdb files in the approriate folder (usually in GAC)
  4. The version of code running on the remote server is exactly the same as in the Visual Studio project you have opened (If possible it is always good to perform fresh build and deployment before trying to debug.
Advertisements

Posted in .NET, Sharepoint | Tagged: , , | 1 Comment »

Converting InfoPath Forms into Visual Studio Projects

Posted by mundeep on February 16, 2009

I was recently trying to converting some InfoPath froms that had been created as per default in the InfoPath client application (and using Visual Studio Tools for Applications for Code-Behind) into a Visual Studio project to be opened in Visual Stdio 2005 as per the MSDN HowTo. However when i reached the last step and opened the masnifest.xsf it would just me show me the xml contents of the file and not the visual form editing GUI that you see in the InfoPath client. Solution was to install Visual Studio 2005 Tools for Office Second Edition (VSTO 2005 SE) and then reopen the project.

Posted in .NET, Sharepoint | Tagged: , , , , | Leave a Comment »

sgen.exe exited with code 1

Posted by mundeep on February 12, 2009

While developing a Sharepoint solution using WSPBuilder and Visual Studio 2005 i noticed that i would get the following error when trying to compile a Release build (on further examination i noticed that it would occur whenever i switched between release & debug builds):

“sgen.exe exited with code 1”

After doing some research i found a several different suggested solutions:

  1. Remove and re-add the project from the solution as per this forum post.
  2. Turn off the “Generate serialization assembly” option in the Build tab of Project Properties see this blogpost and this one.
  3. Remove the previous version of the assembly from the GAC as per this blogpost.

To determine which solution i should use required some more research on sgen.exe does. As per the MSDN article:

When the XML Serializer Generator is not used, a XmlSerializer generates serialization code and a serialization assembly for each type every time an application is run. To improve the performance of XML serialization startup, use the Sgen.exe tool to generate those assemblies the assemblies in advance. These assemblies can then be deployed with the application.

The XML Serializer Generator can also improve the performance of clients that use XML Web service proxies to communicate with servers because the serialization process will not incur a performance hit when the type is loaded the first time.

These generated assemblies cannot be used on the server side of a Web service. This tool is only for Web service clients and manual serialization scenarios.

If the assembly containing the type to serialize is named MyType.dll, then the associated serialization assembly will be named MyType.XmlSerializers.dll.

This means that as well as being impractical the first solution doesn’t really solve the problem.

The second solution ‘solves’ the probelm, however based on the MSDN article it may result in a minor performance hit if the serialization class is required.

In my case i was performing some manual serialization and thus decided to live with the minor annoyance of soltuion #3 and removing the existing assemblies from the GAC whenever i ran into the error.

Posted in .NET, Sharepoint | Tagged: , , , , | Leave a Comment »