Re: Unable to debug in VS 2008 after updating Assembly version using Hg shortrev

Olemis Lang <[email protected]> Thu, 27 May 2010 16:17:49 -0500
Newsgroups gmane.comp.windows.devel.dotnet.advanced
Message-ID <[email protected]>
JFTR ... problem solved

On Wed, May 26, 2010 at 2:28 PM, Olemis Lang <[email protected]> wrote:
[...]
>
> when I build the project AssemblyInfo.cs file contains the right info;
> except security attributes, which I specify in a separate
> AssemblyInfo.Staic.cs file like the one shown below
>
[...]
>
> and the DLL is built correctly since the version of the file
> (considering the value in the property sheet) is set to 1.0.0.rev
> (e.g. 1.0.0.14) . At this point I say : Go, go, go !! and press F5 ...
> ;o)
>
> Everything seems to be fine . When the workflow reaches to a point
> where the debugger needs to be loaded so as to to intercept the
> execution, MS VS 2008 is notified , but it displays a message like
> this
>
> {{{
> The following module was built either with optimizations enabled or
> without debug information:
>
> C:\Windows\assembly\GAC_MSIL\WFMyWorkflow\1.0.0.0__<hash>\WFMyWorkflow.dl=
l
>
> To debug this module, change its project build configuration to Debug
> mode. To suppress this message, disable the 'Warn if no user code on
> launch' debugger option.
> }}}
>
> As you can see version displayed in the message is 1.0.0.0 whereas I
> was expecting 1.0.0.14
>
> Q:
> =A0- What's the problem ?

The problem was that Assembly version in workflow.xml was still
1.0.0.0 (rather than latest calculated version 1.0.0.14 )

> =A0- Does anybody know of any tricks so as to
> =A0 =A0be able to debug the project (i.e. MOSS workflow)
>

Adding the target shown below to the build script (see
GenerateAssemblyInfo in previous message ;o)

{{{
#!xml

  <!--
    Update CodeBesideAssembly Version in workflow.xml manifest file
    based on the current Mercurial Revision. If missing it's
    impossible to debug the workflow in MS VS 2008, and there will
    be many deployment issues.
  -->
  <PropertyGroup>
    <BuildDependsOn>
      UpdateWorkflowManifest;
      $(BuildDependsOn)
    </BuildDependsOn>
  </PropertyGroup>

  <Target Name=3D"UpdateWorkflowManifest"
          Condition=3D" '$(MSBuildCommunityTasksAvailable)' =3D=3D 'true' "
          DependsOnTargets=3D"GenerateAssemblyInfo">
    <XmlUpdate
        Prefix=3D"sp"
        Namespace=3D"http://schemas.microsoft.com/sharepoint/"
        XmlFileName=3D"$(MSBuildProjectDirectory)\workflow.xml"
        Xpath=3D"//sp:Elements/sp:Workflow[@Name=3D'$(AssemblyName)']/@Code=
BesideAssembly"
        Value=3D"$(AssemblyName), Version=3D$(AssemblyVersion),
Culture=3Dneutral, PublicKeyToken=3Dxxx"
        />
  </Target>

}}}

... and it works, Debugger is back once again !!!

--
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
On adding Hessian (RPC) support for Trac -
http://feedproxy.google.com/~r/simelo-en/~3/Vit6dRudChU/on-adding-hessian-r=
pc-support-for-trac.html

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
View archives and manage your subscription(s) at http://peach.ease.lsoft.com/archives