Generic methods

Mar 29, 2008 at 7:49 AM
Hi,
Having this line (if that line is commented out the PipelineBuilder tools successfully generates the pipeline)

T Get<T>();

In a contract I get the following error when I run the PipelineBuilder:

System.NullReferenceException: Object reference not set to an instance of an object.

Server stack trace:
at PipelineBuilder.PipelineBuilder.GetCannonicalContractType(Type contractType) in D:\AppBuilding\PipelineBuilder\PipelineBuilder\PipelineBuilder.cs:line 673
at PipelineBuilder.PipelineBuilder.GetViewTypeReference(SegmentType componentType, Type contractType, Type declaringType) in D:\AppBuilding\PipelineBuilder\PipelineBuilder\PipelineBuilder.cs:line 701
at PipelineBuilder.PipelineBuilder.BuildView(Type contractType, PipelineSegmentSource component, SegmentType componentType, Boolean activatable) in D:\AppBuilding\PipelineBuilder\PipelineBuilder\PipelineBuilder.cs:line 620
at PipelineBuilder.PipelineBuilder.BuildPipeline() in D:\AppBuilding\PipelineBuilder\PipelineBuilder\PipelineBuilder.cs:line 125
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at 0:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at PipelineBuilder.PipelineBuilder.BuildPipeline()
at PipelineBuilder.PipelineBuilder.BuildRemotePipeline() in D:\AppBuilding\PipelineBuilder\PipelineBuilder\PipelineBuilder.cs:line 56
at PipelineBuilder.PipelineBuilder.BuildPipeline() in D:\AppBuilding\PipelineBuilder\PipelineBuilder\PipelineBuilder.cs:line 72
at VSPipelineBuilder.PipelineBuilderWorker.BuildPipeline(String sourceFile) in D:\AppBuilding\PipelineBuilder\VSPipelineBuilder\Connect.cs:line 516
at VSPipelineBuilder.Connect.BuildSource(String source) in D:\AppBuilding\PipelineBuilder\VSPipelineBuilder\Connect.cs:line 349
at VSPipelineBuilder.Connect.BuildPipeline(Project sourceProject, String destPath, String outputPath) in D:\AppBuilding\PipelineBuilder\VSPipelineBuilder\Connect.cs:line 222
at VSPipelineBuilder.Connect.Exec(String commandName, vsCommandExecOption executeOption, Object& varIn, Object& varOut, Boolean& handled) in D:\AppBuilding\PipelineBuilder\VSPipelineBuilder\Connect.cs:line 164

Greetings,
Yordan
Mar 31, 2008 at 7:32 PM
We don't currently support generic methods (or generic types other than IListContract<T>) from the pipeline builder. If you want do to this you can generate the code with the pipeline builder, but without the generic methods, and then add the generic methods to the contract/views and add your own adapter logic for those methods.

--Jesse