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

Olemis Lang <[email protected]> Wed, 26 May 2010 14:28:17 -0500
Newsgroups gmane.comp.windows.devel.dotnet.advanced
Message-ID <[email protected]>
Hello !

I am using MS Visual Studio 2008. Recently I developed a custom
workflow for a MOSS 2007 WSS 3.0 site. Everything works OK (so this is
just background information ;o) , and I can deploy and debug the
workflow . I manage the source code using Mercurial SCM , hence I also
use VS Mercurial plugin . Then I installed =ABMSBuild Mercurial Tasks
Class Library=BB as well as =ABMSBuild Community Tasks=BB because I want to
increment the Assembly Version Number automatically and consistently
so that it will match the local revision number in Hg repos .

In order to do that I added an HgVersion.targets (similar to the
example) file that includes something like this :

{{{
#!xml

=A0<Target Name=3D"GenerateAssemblyInfo"
=A0 =A0 =A0 =A0 =A0Condition=3D" '$(MSBuildCommunityTasksAvailable)' =3D=3D=
 'true' "
=A0 =A0 =A0 =A0 =A0DependsOnTargets=3D"ExtractRevision">
=A0 =A0<PropertyGroup Condition=3D" '$(AssemblyVersionRevision)' =3D=3D '' =
">
=A0 =A0 =A0<AssemblyVersionRevision>0</AssemblyVersionRevision>
=A0 =A0</PropertyGroup>
=A0 =A0<CreateProperty Value=3D"$(AssemblyVersionBase).$(AssemblyVersionRev=
ision)">
=A0 =A0 =A0<Output TaskParameter=3D"Value" PropertyName=3D"AssemblyVersion"=
 />
=A0 =A0</CreateProperty>
=A0 =A0<AssemblyInfo CodeLanguage=3D"CS"

OutputFile=3D"$(MSBuildProjectDirectory)\Properties\AssemblyInfo.cs"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AssemblyDescription=3D""
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AssemblyFileVersion=3D"$(AssemblyVersion=
)"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AssemblyCompany=3D"XXX"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AssemblyProduct=3D"XXX"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AssemblyCopyright=3D"XXX"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AssemblyTrademark=3D""
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AssemblyInformationalVersion=3D"$(Assemb=
lyVersion)"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AssemblyTitle=3D"$(AssemblyName)"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AssemblyVersion=3D"$(AssemblyVersion)"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ComVisible=3D"false"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Guid=3D"xx-xxx-xxxxx-xxxx"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 />
=A0</Target>

}}}

and imported those rules in the project file

{{{
#!xml

<Project>
=A0<!-- Further code omitted ;o)
=A0-->
=A0<Import Project=3D"$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
=A0<Import Project=3D"$(MSBuildExtensionsPath)\Microsoft\Windows Workflow
Foundation\v3.5\Workflow.Targets" />
=A0<Import Project=3D"..\HgVersion.targets" />
</Project>
}}}

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

{{{
#!csharp

// Static Assembly properties
using System.Security;
[assembly: SecurityTransparent()]

}}}

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.dll

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 ?
=A0- Does anybody know of any tricks so as to
=A0 =A0be able to debug the project (i.e. MOSS workflow)

I'm developing in the same (test) server where MOSS 2k7 is installed ,
and everything worked until I performed the changes I mentioned above
:(

Thnx in advance !

--
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