Extensibility Message cannot be converted ...
3 posts • Page 1 of 1
Extensibility Message cannot be converted ...
Occassionally I have ran into a problem trying to compile where it suggests that it is unable to convert the PostSharp.Extensibility.Message. This problem had cropped up once for me, but I was doing stuff with the MessageSink so I restarted Visual Studio and moved on. However, today we promoted the PostSharp stuff for all our developers to use and one of the initial folks had the problem right away.
I had him change the PostSharpUseCommandLine property from "False" to "True", reload the project, and then he built successfully. We went back to the initial "False" value and the problem reoccurred.
Here is the stack trace:
Error 4 The argument type 'PostSharp.Extensibility.Message' cannot be converted into parameter type 'PostSharp.Extensibility.Message'.
Server stack trace:
at System.Runtime.Remoting.Messaging.Message.CoerceArg(Object value, Type pt)
at System.Runtime.Remoting.Messaging.Message.CoerceArgs(MethodBase mb, Object[] args, ParameterInfo[] pi)
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 PostSharp.Extensibility.IMessageSink.Write(Message message)
at PostSharp.Extensibility.MessageSinkAccessor.Write(Message message) in p:\open\branches\1.0\Core\PostSharp.Core\Extensibility\MessageSinkAccessor.cs:line 24
at PostSharp.Extensibility.Messenger.Write(Message message) in p:\open\branches\1.0\Core\PostSharp.Core\Extensibility\Messenger.cs:line 282
at PostSharp.Trace.InternalWriteLine(String message) in p:\open\branches\1.0\Core\PostSharp.Core\Trace.cs:line 170
at PostSharp.Trace.WriteLine(String format) in p:\open\branches\1.0\Core\PostSharp.Core\Trace.cs:line 335
at PostSharp.Extensibility.Tasks.MulticastAttributeTask.Execute() in p:\open\branches\1.0\Core\PostSharp.Core\Extensibility\Tasks\MulticastAttributeTask.cs:line 67
at PostSharp.Extensibility.Project.ExecutePhase(String phase) in p:\open\branches\1.0\Core\PostSharp.Core\Extensibility\Project.cs:line 1041
at PostSharp.Extensibility.Project.Execute() in p:\open\branches\1.0\Core\PostSharp.Core\Extensibility\Project.cs:line 1079
at PostSharp.Extensibility.PostSharpObject.ExecuteProjects() in p:\open\branches\1.0\Core\PostSharp.Core\Extensibility\PostSharpObject.cs:line 581
at PostSharp.Extensibility.PostSharpObject.InvokeProjects(ProjectInvocation[] projectInvocations) in p:\open\branches\1.0\Core\PostSharp.Core\Extensibility\PostSharpObject.cs:line 564
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 [1]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at PostSharp.Extensibility.IPostSharpObject.InvokeProjects(ProjectInvocation[] projectInvocations)
at PostSharp.Extensibility.PostSharpObjectAccessor.InvokeProjects(ProjectInvocation[] projectInvocations) in p:\open\branches\1.0\Core\PostSharp.Core\Extensibility\PostSharpObjectAccessor.cs:line 41
at PostSharp.MSBuild.PostSharp.Execute() in p:\open\branches\1.0\Core\PostSharp.MSBuild\PostSharp.cs:line 169 SoftInn.Services
I had him change the PostSharpUseCommandLine property from "False" to "True", reload the project, and then he built successfully. We went back to the initial "False" value and the problem reoccurred.
Here is the stack trace:
Error 4 The argument type 'PostSharp.Extensibility.Message' cannot be converted into parameter type 'PostSharp.Extensibility.Message'.
Server stack trace:
at System.Runtime.Remoting.Messaging.Message.CoerceArg(Object value, Type pt)
at System.Runtime.Remoting.Messaging.Message.CoerceArgs(MethodBase mb, Object[] args, ParameterInfo[] pi)
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 PostSharp.Extensibility.IMessageSink.Write(Message message)
at PostSharp.Extensibility.MessageSinkAccessor.Write(Message message) in p:\open\branches\1.0\Core\PostSharp.Core\Extensibility\MessageSinkAccessor.cs:line 24
at PostSharp.Extensibility.Messenger.Write(Message message) in p:\open\branches\1.0\Core\PostSharp.Core\Extensibility\Messenger.cs:line 282
at PostSharp.Trace.InternalWriteLine(String message) in p:\open\branches\1.0\Core\PostSharp.Core\Trace.cs:line 170
at PostSharp.Trace.WriteLine(String format) in p:\open\branches\1.0\Core\PostSharp.Core\Trace.cs:line 335
at PostSharp.Extensibility.Tasks.MulticastAttributeTask.Execute() in p:\open\branches\1.0\Core\PostSharp.Core\Extensibility\Tasks\MulticastAttributeTask.cs:line 67
at PostSharp.Extensibility.Project.ExecutePhase(String phase) in p:\open\branches\1.0\Core\PostSharp.Core\Extensibility\Project.cs:line 1041
at PostSharp.Extensibility.Project.Execute() in p:\open\branches\1.0\Core\PostSharp.Core\Extensibility\Project.cs:line 1079
at PostSharp.Extensibility.PostSharpObject.ExecuteProjects() in p:\open\branches\1.0\Core\PostSharp.Core\Extensibility\PostSharpObject.cs:line 581
at PostSharp.Extensibility.PostSharpObject.InvokeProjects(ProjectInvocation[] projectInvocations) in p:\open\branches\1.0\Core\PostSharp.Core\Extensibility\PostSharpObject.cs:line 564
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 [1]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at PostSharp.Extensibility.IPostSharpObject.InvokeProjects(ProjectInvocation[] projectInvocations)
at PostSharp.Extensibility.PostSharpObjectAccessor.InvokeProjects(ProjectInvocation[] projectInvocations) in p:\open\branches\1.0\Core\PostSharp.Core\Extensibility\PostSharpObjectAccessor.cs:line 41
at PostSharp.MSBuild.PostSharp.Execute() in p:\open\branches\1.0\Core\PostSharp.MSBuild\PostSharp.cs:line 169 SoftInn.Services
- bmorley
- Posts: 8
- Joined: Tue Apr 08, 2008 6:08 am
- Full Name: Bob Morley
- Company: Software Innovation
Re: Extensibility Message cannot be converted ...
Hi,
The issue has already been reported, I even had it myself, but I have never been able to understand why this happens. The error occurs when trying to cast a remoting proxy of Message to the type Message, even if both classes are equal and from the same assembly.
I can only recommend to use the command-line using the switch you know (you can change the setting in PostSharp-1.0.targets for global effect). You will also get rid of out-of-memory problems, that also happen without visible reason under Visual Studio.
I currently envision that the version 1.1 will always use the command line utility (another version, however).
Sorry for inconvenience,
Gael
The issue has already been reported, I even had it myself, but I have never been able to understand why this happens. The error occurs when trying to cast a remoting proxy of Message to the type Message, even if both classes are equal and from the same assembly.
I can only recommend to use the command-line using the switch you know (you can change the setting in PostSharp-1.0.targets for global effect). You will also get rid of out-of-memory problems, that also happen without visible reason under Visual Studio.
I currently envision that the version 1.1 will always use the command line utility (another version, however).
Sorry for inconvenience,
Gael
Gael Fraiteur, project leader
got good support? consider donating to the project.
got good support? consider donating to the project.
- gfraiteur
- Site Admin
- Posts: 674
- Joined: Tue Dec 18, 2007 3:09 pm
- Full Name: Gael Fraiteur
- Company: postsharp.org
Re: Extensibility Message cannot be converted ...
Gael Fraiteur, project leader
got good support? consider donating to the project.
got good support? consider donating to the project.
- gfraiteur
- Site Admin
- Posts: 674
- Joined: Tue Dec 18, 2007 3:09 pm
- Full Name: Gael Fraiteur
- Company: postsharp.org
3 posts • Page 1 of 1