2015-12-14 6 views
5

मुझे वेब.कॉन्ग फ़ाइल के साथ एएसपी.NET वेब एपीआई प्रोजेक्ट है। जब यह वीएस2015 में बनाता है, तो कोई त्रुटि नहीं होती है और कोई चेतावनी नहीं दी जाती है। लेकिन जब मैं MSBuild कदम निर्माण का उपयोग कर TeamCity पर इस परियोजना का निर्माण, मैं MSB3247 चेतावनी मिल:टीमसिटी में एमएसबिल्ड चरण एएसपी.नेट वेब एपीआई प्रोजेक्ट के लिए web.config के बजाय app.config को मानता है जिसके परिणामस्वरूप एमएसबी 3247

[ResolveAssemblyReferences] ResolveAssemblyReference 
[14:30:01] : [ResolveAssemblyReference] No way to resolve conflict between "protobuf-net, Version=2.0.0.602, Culture=neutral, PublicKeyToken=257b51d87d2e4d67" and "protobuf-net, Version=2.0.0.480, Culture=neutral, PublicKeyToken=257b51d87d2e4d67". Choosing "protobuf-net, Version=2.0.0.602, Culture=neutral, PublicKeyToken=257b51d87d2e4d67" arbitrarily. 
[14:30:01] : [ResolveAssemblyReference] No way to resolve conflict between "Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" and "Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed". Choosing "Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" arbitrarily. 
[14:30:01] : [ResolveAssemblyReference] Consider app.config remapping of assembly "protobuf-net, Culture=neutral, PublicKeyToken=257b51d87d2e4d67" from Version "2.0.0.602" [] to Version "2.0.0.668" [D:\TeamCity\buildAgent\work\2772494ce0e0bbd7\branches\Stategic.Window.Release1\src\Strategic.Window\packages\protobuf-net.2.0.0.668\lib\net40\protobuf-net.dll] to solve conflict and get rid of warning. 
[14:30:01] : [ResolveAssemblyReference] Consider app.config remapping of assembly "Newtonsoft.Json, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" from Version "6.0.0.0" [] to Version "7.0.0.0" [D:\TeamCity\buildAgent\work\2772494ce0e0bbd7\branches\Stategic.Window.Release1\src\Strategic.Window\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll] to solve conflict and get rid of warning. 
[14:30:01] : [ResolveAssemblyReference] Consider app.config remapping of assembly "RazorEngine, Culture=neutral, PublicKeyToken=9ee697374c7e744a" from Version "3.0.8.0" [] to Version "3.7.4.0" [D:\TeamCity\buildAgent\work\2772494ce0e0bbd7\branches\Stategic.Window.Release1\src\Strategic.Window\packages\RazorEngine.3.7.4\lib\net45\RazorEngine.dll] to solve conflict and get rid of warning. 
[14:30:01] : [ResolveAssemblyReference] Consider app.config remapping of assembly "WebGrease, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "1.5.1.25624" [] to Version "1.5.2.14234" [D:\TeamCity\buildAgent\work\2772494ce0e0bbd7\branches\Stategic.Window.Release1\src\Strategic.Window\packages\WebGrease.1.5.2\lib\WebGrease.dll] to solve conflict and get rid of warning. 
[14:30:01]W: [ResolveAssemblyReference] C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1819, 5): warning MSB3247: Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file: <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="protobuf-net" culture="neutral" publicKeyToken="257b51d87d2e4d67" /><bindingRedirect oldVersion="0.0.0.0-2.0.0.668" newVersion="2.0.0.668" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" /><bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="RazorEngine" culture="neutral" publicKeyToken="9ee697374c7e744a" /><bindingRedirect oldVersion="0.0.0.0-3.7.4.0" newVersion="3.7.4.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="WebGrease" culture="neutral" publicKeyToken="31bf3856ad364e35" /><bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /></dependentAssembly></assemblyBinding> 

, app.config फ़ाइल Web.config के बजाय MSBuild द्वारा विचार किया जा रहा है की तरह लग रहा है क्योंकि यह bindingRedirtect, जोड़ने का प्रस्ताव है जो मेरी Web.config फ़ाइल में पहले से मौजूद हैं। मैंने कॉपी-पेस्टिंग Web.config द्वारा इसे दोबारा जांच लिया और इसे App.config पर नामित किया। इसने चेतावनी को हटा दिया। जब App.config हटा दिया जाता है - चेतावनी फिर से दिखाई देती है। तो मेरे प्रश्न 1 हैं) क्यों एमएसबिल्ड ऐप.कॉन्फिग का उपयोग कर रहा है, असफल नहीं है जब मेरे पास प्रोजेक्ट में केवल Web.config है; 2) मैं बाध्यकारी रीडायरेक्ट के लिए Web.config का उपयोग करने के लिए MSBuild को एक संकेत कैसे दे सकता हूं? 3) वीएस में बिल्कुल एक ही परियोजना का निर्माण क्यों चेतावनी नहीं देता है?

उत्तर

6

समस्या यह है कि माइक्रोसॉफ़्ट वेब डेवलपर टूल्स स्थापित नहीं है। MSBuild को इस तरह के मामले में web.config फ़ाइलों को ठीक से कैसे संभालना है, यह नहीं पता है।

संभावित समाधान:

  1. TeamCity सर्वर पर Microsoft ASP.NET और वेब उपकरण 2015 स्थापित

  2. कॉपी TeamCity सर्वर से उन फ़ोल्डर

    • ग: \ Program Files (x86) \ MSBuild \ Microsoft \ VisualStudio \ v14.0 \ WebApplications \
    • सी: \ प्रोग्राम फ़ाइलें (x86) \ MSBuild \ Microsoft \ Visual स्टूडियो \ v14.0 \ वेब \

    सुनिश्चित करें कि वेब csproj में <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" /> सही है।

फ़ाइल माइक्रोसॉफ्ट.WebApplication.targets वेब फ़ोल्डर में फ़ाइलों का संदर्भ देता है, इसलिए, यह भी जगह में होना चाहिए।

समाधान here से कटाई की गई थी।

संबंधित मुद्दे