exception when generating files for SvcUtil.exe


I am trying to write out to files source code for SvcUtil.exe.
Choose svcutil.exe, go to Tools menu, choose "Generate Files"
A few files get written out, and then the Reflector crashes with the unhandled exception.
The exception also happens if file generation is called by right-click-Menu->Export, but in this case it's handled and does not cause the Reflector to crash.
Stack trace below.
System.InvalidOperationException was unhandled
Message="Block statement count of zero during condition expression translation."
   at ឺ.ᜆ(Int32 A_0)
   at ឺ.ᜋ(Int32 A_0)
   at ឺ.ᜂ(Int32 A_0, Int32 A_1)
   at ឺ.ᜆ(Int32 A_0)
   at ឺ.ᜋ(Int32 A_0)
   at ឺ.ᜂ(Int32 A_0, Int32 A_1)
   at ឺ.ᜀ(IMethodDeclaration A_0, IMethodBody A_1)
   at ឤ.ᜀ(IMethodDeclaration A_0)
   at ᜭ.ᜁ(IMethodDeclarationCollection A_0)
   at ឤ.ᜀ(ITypeDeclaration A_0)
   at ឥ.ᜀ(ITypeDeclaration A_0, Boolean A_1, Boolean A_2)
   at FileGenerator.AddIn.Generators.TypeFileGenerator.GetFormatter()
   at FileGenerator.AddIn.Generators.TypeFileGenerator.Generate()
   at FileGenerator.AddIn.Generators.NamespaceFileGenerator.Generate()
   at FileGenerator.AddIn.UI.FileGeneratorControl.GenerateFiles(Object data)
   at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)

file attachments

Closed Mar 2, 2009 at 10:17 PM by jasonrbock
Bug with Reflector (probably)


jprusakova wrote Feb 16, 2009 at 5:59 PM

The error is thrown when generating Options.cs. The source is not generated, although the file is created (attached).

jasonrbock wrote Mar 2, 2009 at 10:16 PM

I would suggest sending this to RedGate - seems like it's an issue with Reflector not being able to handle something with the Options type in Microsoft.Tools.ServiceModel.SvcUtil.