小故事:使用TFS 2010,我無法使用特定版本的Oracle.DataAcess構建構建服務器,這需要在我的目標服務器上。TFS構建:引用與在buyild服務器上不同的Oracle版本
對於整個企業來說,我們有一個構建服務器,這個企業混合使用Oracle,.Net和OS版本。我正在構建的項目針對的是與構建服務器上的內容不同的Oracle.DataAccess.dll版本的服務器。如果我在我的本地機器上構建它並將其部署到開發服務器,那麼它工作正常。但我似乎無法讓構建服務器忽略它的客戶端版本並使用我的。
我讀了幾個優秀的問題和答案,比如這一個pantelif回答: Solution.metaproj error MSB3202: The project file 'xxx' was not found
我覺得我做的一切權利。我甚至在我的項目中包含一個Ref文件夾,並從那裏直接引用.dll。所以我不想從一個不同的位置引用.dll。
如果我設置特定版本= false,則會得到一個運行時Oracle錯誤,告訴我Oracle客戶端的版本是錯誤的。如果手動將.dll的正確版本複製到bin文件夾中,則會出現運行時錯誤,指出程序集定位到不同的版本。
如果我設置特定版本= true,則生成服務器說,它無法找到該.dll
Class\ProvData.cs (7): The type or namespace name 'Oracle' could not be found (are you missing a using directive or an assembly reference?)
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1360): Could not resolve this reference. Could not locate the assembly "Oracle.DataAccess, Version=1.102.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
當我看着我的項目文件,我看到了我所期望的:
<Reference Include="Oracle.DataAccess, Version=1.102.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342">
<HintPath>Ref\Oracle.DataAccess.dll</HintPath>
<Private>True</Private>
</Reference>
那麼,爲什麼構建服務器仍然說它無法找到它的任何想法?