Tommie 的个人资料: : Tommie照片日志列表更多 工具 帮助

日志


Adapter still not working

(Summary of my newly added post in this thread: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2524723&SiteID=1&mode=1).

I'm having serious problems deploying the adapter. First of all, I've commented all content of MakeDataChanges() method so that it just looks like this now:

public DataChangesResult MakeDataChanges() { return DataChangesResult.NoChanges; }

This is just temporary so it will be easier for me to analyze the errors made. Got some tips on the MSDN forum to add this part to MakeSchemaChanges, just to make sure I'm not adding a Fact twice (the code below is added in the beginning of the method, after getting your warehouse config variable):

//Check if the fact exists Fact myFact = config.GetFact("Code Metrics"); if (myFact != null) return SchemaChangesResult.NoChanges;

(After this part, the rest of MakeSchemaChanges() follows). Furthermore I've altered my try-catch statements to look something like this:

try { m_dataStore.Add(config); m_dataStore.CommitTransaction(); } catch { try { m_dataStore.RollbackTransaction(); } catch (Exception ex) { m_dataStore.LogEvent(AdapterEventLevel.Error, ex.ToString()); return SchemaChangesResult.NoChanges; } throw; }

That is; rethrowing the same exception that I catch, and not hiding the exception if RollbackTransaction also throws. So far so good. But this is recorded in the Event Viewer when I try running the adapter:

TF53010: The following error has occurred in a Team Foundation component or extension:
Date (UTC): 12/8/2007 4:17:57 PM
Machine: ORCASBETA2_TFSV
Application Domain: /LM/W3SVC/1747463155/Root/Warehouse-11-128416042576020816
Assembly: Microsoft.TeamFoundation.Warehouse, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a; v2.0.50727
Process Details:
  Process Name: w3wp
  Process Id: 2972
  Thread Id: 1504
  Account name: ORCASBETA2_TFSV\TFSSERVICE
Detailed Message: TF51209: A run-time error System.Data.SqlClient.SqlException: Invalid column name 'Team Project'.
Invalid column name 'Team Project'.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Microsoft.TeamFoundation.Warehouse.WarehouseSchemaCreator.SqlExecuteNonQuery(SqlCommand cmd)
   at Microsoft.TeamFoundation.Warehouse.WarehouseSchemaCreator.CreatePrc_Fact_X_AddUpdate(SqlConnection cn, SqlTransaction tr)
   at Microsoft.TeamFoundation.Warehouse.WarehouseSchemaCreator.CreateStoredProcedures(SqlConnection cn, SqlTransaction tr)
   at Microsoft.TeamFoundation.Warehouse.WarehouseSchemaCreator.ProcessNewConfig(WarehouseConfig config)
   at Microsoft.TeamFoundation.Warehouse.AdapterDataStore.Add(WarehouseConfig newConfig)
   at CodeMetricsAdapter.CMAdapter.MakeSchemaChanges()
   at Microsoft.TeamFoundation.Warehouse.AdapterWrapper.MakeSchemaChanges() occurred on adapter CodeMetricsAdapter.CMAdapter.
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

And also this:

TF53010: The following error has occurred in a Team Foundation component or extension:
Date (UTC): 12/8/2007 4:17:57 PM
Machine: ORCASBETA2_TFSV
Application Domain: /LM/W3SVC/1747463155/Root/Warehouse-11-128416042576020816
Assembly: Microsoft.TeamFoundation.Warehouse, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a; v2.0.50727
Process Details:
  Process Name: w3wp
  Process Id: 2972
  Thread Id: 1504
  Account name: ORCASBETA2_TFSV\TFSSERVICE
Detailed Message: Schema change failed. \r\nConfig:\r\n<?xml version="1.0" encoding="utf-16"?>
<WarehouseConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Facts>
    <Fact>
      <Name>Code Churn</Name>
      <FriendlyName>Code Churn</FriendlyName>
      <PerspectiveName>Code Churn</PerspectiveName>
      <IncludeCountMeasure>true</IncludeCountMeasure>
     .... [some more of warehouseschema.xml but nothing on code metric]...
          <SourceField>_Microsoft_V
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

So I guess the schema change fails, probably because the config.add(...) fails. But why?

评论

请稍候...
很抱歉,您输入的评论太长。请缩短您的评论。
您没有输入任何内容,请重试。
很抱歉,我们当前无法添加您的评论。请稍后重试。
若要添加评论,需要您的家长授予您相应权限。请求权限
您的家长禁用了评论功能。
很抱歉,我们当前无法删除您的评论。请稍后重试。
您已超过了一天之内允许提供的评论数上限。请在 24 小时后重试。
因为我们的系统表明您可能在向其他用户提供垃圾评论,您的帐户已禁用了评论功能。如果您认为我们错误地禁用了您的帐户,请联系 Windows Live 支持部门
完成下面的安全检查,您提供评论的过程才能完成。
您在安全检查中键入的字符必须与图片或音频中的字符一致。

若要添加评论,请使用您的 Windows Live ID 登录(如果您使用过 Hotmail、Messenger 或 Xbox LIVE,您就拥有 Windows Live ID)。登录


还没有 Windows Live ID 吗?请注册

引用通告

此日志的引用通告 URL 是:
http://tomfury.spaces.live.com/blog/cns!F58BF7D0B46F52B9!304.trak
引用此项的网络日志