2011-12-09 54 views
0

在vs 2010中,右鍵單擊並更新指向我的xamlx工作流服務項目的服務引用,會引發錯誤(寫入原始的HTML)指出:更新xamlx-workflow服務引用拋出XamlObjectWriterException:'無法創建未知類型[...]'

XamlObjectWriterException: '無法創建未知類型[...]'

[...]指出我的項目的消息變量。

我的工作流是使用WorkflowServiceHost類託管的xamlx。

它似乎是由於SendResponse消息。消息類型使用[DataContract][DataMember],並且在內容UI中選擇了「參數」。

找不到我的消息類型究竟是什麼東西。也許這是在我的wkf項目的建設屬性...

任何幫助是非常歡迎。

這裏是發回的HTML:


There was an error downloading 'http://localhost:8008/WfDerogationCreation.xamlx'. 
There was an error downloading 'http://localhost:8008/WfDerogationCreation.xamlx'. 
The request failed with the error message: 
-- 
<html> 
    <head> 
     <title>'Cannot create unknown type '{http://schemas.microsoft.com/netfx/2009/xaml/activities}Variable({clr-namespace:CompanyName.WorkflowSecurity.Derogation.Messages;assembly=CompanyName.WorkflowSecurity}DerogRequest)'.' Line number '4' and line position '8'.</title> 
     <style> 
     body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} 
     p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} 
     b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} 
     H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } 
     H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } 
     pre {font-family:"Lucida Console";font-size: .9em} 
     .marker {font-weight: bold; color: black;text-decoration: none;} 
     .version {color: gray;} 
     .error {margin-bottom: 10px;} 
     .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } 
     </style> 
    </head> 
<body bgcolor="white"> 
      <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1> 
      <h4> <i>'Cannot create unknown type '{http://schemas.microsoft.com/netfx/2009/xaml/activities}Variable({clr-namespace:CompanyName.WorkflowSecurity.Derogation.Messages;assembly=CompanyName.WorkflowSecurity}DerogRequest)'.' Line number '4' and line position '8'.</i> </h4></span> 
      <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "> 
      <b> Description: </b>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
      <br><br> 
      <b> Exception Details: </b>System.Xaml.XamlObjectWriterException: 'Cannot create unknown type '{http://schemas.microsoft.com/netfx/2009/xaml/activities}Variable({clr-namespace:CompanyName.WorkflowSecurity.Derogation.Messages;assembly=CompanyName.WorkflowSecurity}DerogRequest)'.' Line number '4' and line position '8'.<br><br> 
      <b>Source Error:</b> <br><br> 
      <table width=100% bgcolor="#ffffcc"> 
       <tr> 
        <td> 
         <code> 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code> 
        </td> 
       </tr> 
      </table> 
      <br> 
      <b>Stack Trace:</b> <br><br> 
      <table width=100% bgcolor="#ffffcc"> 
       <tr> 
        <td> 
         <code><pre> 
[XamlObjectWriterException: 'Cannot create unknown type '{http://schemas.microsoft.com/netfx/2009/xaml/activities}Variable({clr-namespace:CompanyName.WorkflowSecurity.Derogation.Messages;assembly=CompanyName.WorkflowSecurity}DerogRequest)'.' Line number '4' and line position '8'.] 
    System.Xaml.XamlObjectWriter.WriteStartObject(XamlType xamlType) +1131129 
    System.Xaml.XamlWriter.WriteNode(XamlReader reader) +158 
    System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter, Boolean closeWriter) +106 
    System.Xaml.XamlServices.Load(XamlReader xamlReader) +56 
    System.ServiceModel.Activities.Activation.WorkflowServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +302 
    System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1461 
    System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +44 
    System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +651 

[ServiceActivationException: The service '/WfDerogationCreation.xamlx' cannot be activated due to an exception during compilation. The exception message is: 'Cannot create unknown type '{http://schemas.microsoft.com/netfx/2009/xaml/activities}Variable({clr-namespace:CompanyName.WorkflowSecurity.Derogation.Messages;assembly=CompanyName.WorkflowSecurity}DerogRequest)'.' Line number '4' and line position '8'..] 
    System.Runtime.AsyncResult.End(IAsyncResult result) +688590 
    System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +190 
    System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, String routeServiceVirtualPath, Boolean flowContext, Boolean ensureWFService) +234 
    System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +379 
    System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148 
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75 
</pre></code> 
        </td> 
       </tr> 
      </table> 
      <br> 
      <hr width=100% size=1 color=silver> 
      <b>Version Information:</b> Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237 
      </font> 
    </body> 
</html> 
<!-- 
[XamlObjectWriterException]: 'Cannot create unknown type '{http://schemas.microsoft.com/netfx/2009/xaml/activities}Variable({clr-namespace:CompanyName.WorkflowSecurity.Derogation.Messages;assembly=CompanyName.WorkflowSecurity}DerogRequest)'.' Line number '4' and line position '8'. 
    at System.Xaml.XamlObjectWriter.WriteStartObject(XamlType xamlType) 
    at System.Xaml.XamlWriter.WriteNode(XamlReader reader) 
    at System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter, Boolean closeWriter) 
    at System.Xaml.XamlServices.Load(XamlReader xamlReader) 
    at System.ServiceModel.Activities.Activation.WorkflowServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) 
    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath) 
    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath) 
    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) 
[ServiceActivationException]: The service '/WfDerogationCreation.xamlx' cannot be activated due to an exception during compilation. The exception message is: 'Cannot create unknown type '{http://schemas.microsoft.com/netfx/2009/xaml/activities}Variable({clr-namespace:CompanyName.WorkflowSecurity.Derogation.Messages;assembly=CompanyName.WorkflowSecurity}DerogRequest)'.' Line number '4' and line position '8'.. 
    at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) 
    at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) 
    at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, String routeServiceVirtualPath, Boolean flowContext, Boolean ensureWFService) 
    at System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) 
    at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 
-->## Heading ## 
--. 
Metadata contains a reference that cannot be resolved: 'http://localhost:8008/WfDerogationCreation.xamlx'. 
The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error. 
If the service is defined in the current solution, try building the solution and adding the service reference again. 
+0

您需要使用[Fusion log viewer。](http://msdn.microsoft.com/en-us/library/e74a18c4(v = VS.100).aspx)進行調試。只需確保運行它作爲管理員,打開日誌,然後重新啓動,然後再嘗試調試。您將看到CLR正在查找程序集的位置以及哪個版本,並從那裏確定它未找到的原因(如果您已安裝它)。 – Will

回答

1

我終於解決了這個問題是這樣的:

在夫婦ReceiveResponse/SendReply活動。

1 /刪除SendReply。 2 /通過右鍵單擊ReceiveResponse活動並重置屬性(如刪除的屬性)來重新創建SendReply。

Xamlx服務引用然後上傳得很好......

發現該錯誤消息是相當不恰當的寫在原始的HTML,我的屏幕不夠大,閱讀這一切。無論如何,謝謝你的幫助。

0

這是告訴你,它不知道CompanyName.WorkflowSecurity.Derogation.Messages的XAML中堆棧的方式。你需要做的是弄清楚爲什麼它不知道這種類型。

雖然「CompanyName.WorkflowSecurity} DerogRequest」注意到'}',但程序集名稱看起來很奇怪嗎?這是一個錯字嗎?

檢查的行號「4」和線位置XAMLX文件「8」

+0

嗨,羅恩。實際上,我在Xaml中討論的這條線只是對我的類型的引用,而不是它自己的類型實現。 DerogRequest是消息類型的名稱,括號中的部分是名稱空間。 但我最終發現如何解決我的問題。 –

相關問題