2010-04-08 21 views
6

मैंने यहां कई अन्य एसजेन से संबंधित प्रश्नों को देखा है और या तो उनके उत्तर लागू नहीं होते हैं या उनके उत्तर मेरे लिए यह ठीक नहीं करते हैं। मैंने इस मुद्दे को कोई भाग्य के साथ ठीक करने के लिए कई एसडीके स्थापित किए हैं। संदर्भ प्रकारों को बदला नहीं जाना चाहिए क्योंकि यह एकमात्र जगह है जहां यह एक समस्या है। एक बार सुझाव है कि SGen.exe को C:\Windows\Microsoft.NET\Framework\v3.5 फ़ोल्डर में डालना है, लेकिन यह उस बॉक्स पर नहीं किया गया है जहां यह कोई समस्या नहीं है। इस परिदृश्य में, SGen.exe वास्तव में मौजूद है और यह सही है जहां यह होना चाहिए, लेकिन एमएसबिल्ड को अभी भी किसी कारण से इसे ढूंढने में समस्याएं हैं!एमएसबिल्ड समाधान को संकलित करते समय एसजीएन नहीं ढूंढ सकता

पृष्ठभूमि:

हम एक NAnt स्क्रिप्ट है कि हमारे बनाता है स्वचालित है। इस परिदृश्य में, एनएएनटी एमएसबिल्ड को बुला रहा है और एमएसबिल्ड एसजीएन को खोजने में असमर्थ होने का दावा करने वाली त्रुटि उत्पन्न कर रहा है। परियोजना .NET 3.5-आधारित है। मेरे पास मेरा प्राथमिक देव पर्यावरण (64-बिट विस्टा अल्टीमेट) है जहां स्क्रिप्ट पूरी तरह से काम करती है और मैं इसे वीएम (64-बिट विन 7 अल्टीमेट) में डुप्लिकेट करने का प्रयास कर रहा हूं। मुझे लगता है कि मेरे पास उस बिंदु पर सबकुछ है जहां मुझे अच्छा होना चाहिए लेकिन यह Win7 बॉक्स पर विफल रहता है (Vista बॉक्स पर पूरी तरह से काम करता है)।

मैंने दो बक्से के बीच कुछ तुलना की है और वे दोनों इस संबंध में समान दिखते हैं, लेकिन यह अभी भी विफल रहता है। उदाहरण के लिए, HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework का sdkInstallRootv2.0 मान दोनों मशीनों पर C:\Program Files\Microsoft.NET\SDK\v2.0 64bit\ पर सेट किया गया है। दोनों मशीनों में, SGen.exe उस पथ के bin उपनिर्देशिका में है।

NAnt स्क्रिप्ट:

report-installer: 

    [exec] Microsoft (R) Build Engine Version 3.5.30729.4926 
    [exec] [Microsoft .NET Framework, Version 2.0.50727.4927] 
    [exec] Copyright (C) Microsoft Corporation 2007. All rights reserved. 
    [exec] 
    [exec] Build started 4/8/2010 11:28:23 AM. 
    [exec] Project "C:\Projects\Production\Tools\ReportInstaller\ReportInstaller.sln" on node 0 (default targets). 
    [exec] Building solution configuration "Release|Any CPU". 
    [exec] Project "C:\Projects\Production\Tools\ReportInstaller\ReportInstaller.sln" (1) is building "C:\Projects\Production\Tools\ReportInstaller\ReportInstaller.csproj" (2) on node 0 (default targets). 
    [exec] Could not locate the .NET Framework SDK. The task is looking for the path to the .NET Framework SDK at the location specified in the SDKInstallRootv2.0 value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework. You may be able to solve the problem by doing one of the following: 1.) Install the .NET Framework SDK. 2.) Manually set the above registry key to the correct location. 
    [exec] CoreCompile: 
    [exec] Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files. 
    [exec] C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1902,9): error MSB3091: Task failed because "sgen.exe" was not found, or the .NET Framework SDK v2.0 is not installed. The task is looking for "sgen.exe" in the "bin" subdirectory beneath the location specified in the SDKInstallRootv2.0 value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework. You may be able to solve the problem by doing one of the following: 1.) Install the .NET Framework SDK v2.0. 2.) Manually set the above registry key to the correct location. 3.) Pass the correct location into the "ToolPath" parameter of the task. 
    [exec] Done Building Project "C:\Projects\Production\Tools\ReportInstaller\ReportInstaller.csproj" (default targets) -- FAILED. 
    [exec] Done Building Project "C:\Projects\Production\Tools\ReportInstaller\ReportInstaller.sln" (default targets) -- FAILED. 
    [exec] 
    [exec] Build FAILED. 
    [exec] 
    [exec] "C:\Projects\Production\Tools\ReportInstaller\ReportInstaller.sln" (default target) (1) -> 
    [exec] "C:\Projects\Production\Tools\ReportInstaller\ReportInstaller.csproj" (default target) (2) -> 
    [exec] (GenerateSerializationAssemblies target) -> 
    [exec] C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1902,9): error MSB3091: Task failed because "sgen.exe" was not found, or the .NET Framework SDK v2.0 is not installed. The task is looking for "sgen.exe" in the "bin" subdirectory beneath the location specified in the SDKInstallRootv2.0 value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework. You may be able to solve the problem by doing one of the following: 1.) Install the .NET Framework SDK v2.0. 2.) Manually set the above registry key to the correct location. 3.) Pass the correct location into the "ToolPath" parameter of the task. 
    [exec] 
    [exec]  0 Warning(s) 
    [exec]  1 Error(s) 
    [exec] 
    [exec] Time Elapsed 00:00:00.24 
    [call] C:\Projects\Production\Source\reports.build(15,4): 
    [call] External Program Failed: C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe (return code was 1) 

क्या मैं गलत है कि यहाँ खड़ी कर रहा है कर रहा हूँ MSBuild अभी भी SGen खोजने में असमर्थ होने के लिए:

<target name="report-installer" depends="fail-if-environment-not-set"> 
    <exec program="MSBuild.exe" basedir="${framework35.directory}"> 
     <arg value="${tools.directory.current}\ReportInstaller\ReportInstaller.sln" /> 
     <arg value="/p:Configuration=${buildconfiguration.current}" /> 
    </exec> 
</target> 

त्रुटि संदेश मिल रहा है?

+0

स्पष्टीकरण के लिए, मैंने 3.5 और 2.0 एसडीके स्थापित किए हैं और उनमें से कोई भी इसके लिए व्यवहार बदल नहीं गया है। – Jaxidian

+0

क्या आप पहले से ही अपने समाधान को एमएसबिल्ड करने की कोशिश कर रहे हैं (बिना एनएएनटी द्वारा बुलाए जा रहे हैं)? – Filburt

+0

यूप, एक ही समस्या। – Jaxidian

उत्तर

-2

मुझे यकीन नहीं है कि यह क्यों हो रहा था या क्यों यह हो रहा था लेकिन मैंने इसके आसपास क्या किया था, विजुअल स्टूडियो 2005 को स्थापित करना था। मैंने पहले से ही .NET 2.0 एसडीके स्थापित किया था और साथ ही .NET 3.5 SDK को कोई भाग्य नहीं मिला था लेकिन विजुअल स्टूडियो 2005 इंस्टॉलर के साथ कुछ मेरे लिए इस मुद्दे को हल किया। यह एक कठिन समाधान है, लेकिन फिर भी, यह एक समाधान था।

उम्मीद है कि हम जल्द ही .NET 4.0 पर माइग्रेट कर सकते हैं और .NET 2.0 और इसके मुद्दों से छुटकारा पा सकते हैं।

16

यह एक आम मुद्दा प्रतीत होता है जो मैंने अभी इन दिनों में भाग लिया था।

"बिल्ड" टैब पर

अपनी परियोजना गुण में सेट विकल्प "क्रमबद्धता विधानसभा उत्पन्न करें" "स्वचालित" से करने के लिए " बंद"।


अद्यतन

आप पहले से ही करने की कोशिश की नहीं तो सुनिश्चित करें कि <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> रिलीज और डिबग विन्यास के लिए निर्धारित है।

+0

मैंने कोशिश की और व्यवहार में कोई बदलाव नहीं आया। मेरी बिल्ड स्क्रिप्ट का यह हिस्सा एक एकल-प्रोजेक्ट समाधान है और मैंने उस '.csproj' फ़ाइल में देखा है और इसमें' Off 'है जब से मैंने उस सेटिंग को बदल दिया, लेकिन मुझे एक ही त्रुटि मिलती है। – Jaxidian

+0

अपने अपडेट का जवाब देने के लिए: मैंने इसके बारे में सोचा था और यह कोई मुद्दा नहीं था। – Jaxidian

+1

धन्यवाद Filburt, जो मेरे लिए काम करता है, मुझे यकीन नहीं है कि अगर मुझे SerializationAssemblies की आवश्यकता होती है तो मैं क्या करूँगा। : -] – Myster

0

मुझे लगता है कि वी.एस. के पुराने संस्करण को स्थापित करने के दर्द के बिना एक समाधान

निम्नलिखित का प्रयास करें है:

  • डाउनलोड + .NET फ्रेमवर्क 2.0 सॉफ्टवेयर डेवलपमेंट किट (SDK) (x86) स्थापित :

कुंजी:: एच https://www.microsoft.com/en-us/download/details.aspx?id=19988

  • करें कि निम्न RegKey मौजूद है EY_LOCAL_MACHINE \ SOFTWARE \ Microsoft.NETFramework \ v2.0 \

    स्ट्रिंग मान: नाम: InstallationFolder मूल्य (डिफ़ॉल्ट): C: \ Program Files (x86) \ Microsoft.NET \ एसडीके \ v2.0 \

    या इस कोड के रूप में reg फ़ाइल को बचाने और निष्पादित करें:

    Windows Registry Editor Version 5.00 
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v2.0] 
    "InstallationFolder"="C:\\Program Files (x86)\\Microsoft.NET\\SDK\\v2.0 
    
  • 0

    अपनी परियोजना गुण में "बिल्ड" टैब पर विकल्प "ऑटो" से "क्रमबद्धता विधानसभा उत्पन्न करें" के लिए "बंद" की स्थापना की।

    यह मेरी समस्या का समाधान किया।

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

    • कोई संबंधित समस्या नहीं^_^