मेरे पास एक F # नकली स्क्रिप्ट है जो पैकेज फ़ाइलों को निकालने के लिए Nuge.Core
के साथ काम करती है। अगर मैं इसे सी # कंसोल ऐप के साथ करने की कोशिश करता हूं तो सब ठीक से काम करता है। हालांकि अगर मैं एक f # नकली लिपि में एक ही स्क्रिप्ट निष्पादित करता हूं तो यह काम नहीं कर रहा है। nuget.core
एफ # स्क्रिप्ट में सी # कोड निष्पादित करने से अप्रत्याशित व्यवहार
यह आप सी # नमूना आप की जरूरत के लिए Docker.DotNet.2.124.3.nupkg
डाउनलोड करने की आवश्यकता पुन: पेश करने के लिए docker.dotnet
, fake
, f#
, यहाँ इतने सारे निर्भरता रहे हैं और मुझे लगता है पता नहीं है, जहां एक की मदद के लिए देखने के लिए है कंसोल अनुप्रयोग और nuget.core
nuget पैकेज स्थापित करने के लिए। यह काम कर रहा है!
class Program
{
static void Main()
{
var zip = new NuGet.ZipPackage(@"Docker.DotNet.2.124.3.nupkg");
foreach (var file in zip.GetFiles())
{
System.Console.WriteLine(file.Path);
}
}
}
च # नमूने के लिए आप की ओर से इन दोनों फ़ाइलों पक्ष की जरूरत है: https://gist.github.com/mynkow/e6f0e550fcacc268dd1e9b743e17d344
त्रुटि:
==============================================================================
FsiEvaluationException:
Error: System.InvalidOperationException: 'NETStandard.Library' already has a dependency defined for 'Microsoft.NETCore.Platforms'.
at NuGet.Manifest.ValidateDependencySets(IPackageMetadata metadata)
at NuGet.Manifest.Validate(Manifest manifest)
at NuGet.Manifest.ReadFrom(Stream stream, IPropertyProvider propertyProvider, Boolean validateSchema)
at NuGet.LocalPackage.ReadManifest(Stream manifestStream)
at NuGet.ZipPackage.EnsureManifest(Func`1 manifestStreamFactory)
at NuGet.ZipPackage..ctor(String filePath, Boolean enableCaching)
at <StartupCode$FSI_0005>[email protected]() in C:\Users\mynkow\Desktop\Reproduce\test.fsx:line 12
Stopped due to error
Output: [Loading C:\Users\mynkow\Desktop\Reproduce\test.fsx]
==============================================================================
Input: C:\Users\mynkow\Desktop\Reproduce\test.fsx
\Arguments:
C:\fsi.exe
Exception: Yaaf.FSharp.Scripting.FsiEvaluationException: Error while compiling or executing fsharp snippet. ---> System.Exception: Operation failed. The error text has been print the error stream. To return the corresponding FSharpErrorInfo use the EvalInteractionNonThrowing, EvalScriptNonThrowing or EvalExpressionNonThrowing
at Microsoft.FSharp.Compiler.Interactive.Shell.FsiEvaluationSession.commitResult[a,b](FSharpChoice`2 res)
at Microsoft.FSharp.Compiler.Interactive.Shell.FsiEvaluationSession.EvalScript(String filePath)
at [email protected](String arg00) in C:\code\FAKE\paket-files\matthid\Yaaf.FSharp.Scripting\src\source\Yaaf.FSharp.Scripting\YaafFSharpScripting.fs:line 1303
at [email protected](Unit unitVar0) in C:\code\FAKE\paket-files\matthid\Yaaf.FSharp.Scripting\src\source\Yaaf.FSharp.Scripting\YaafFSharpScripting.fs:line 1277
at Yaaf.FSharp.Scripting.Helper.consoleCapture[a](TextWriter out, TextWriter err, FSharpFunc`2 f) in C:\code\FAKE\paket-files\matthid\Yaaf.FSharp.Scripting\src\source\Yaaf.FSharp.Scripting\YaafFSharpScripting.fs:line 1221
at [email protected][a](Boolean preventStdOut, OutStreamHelper out, OutStreamHelper err, FSharpFunc`2 f) in C:\code\FAKE\paket-files\matthid\Yaaf.FSharp.Scripting\src\source\Yaaf.FSharp.Scripting\YaafFSharpScripting.fs:line 1254
at Yaaf.FSharp.Scripting[email protected](String text) in C:\code\FAKE\paket-files\matthid\Yaaf.FSharp.Scripting\src\source\Yaaf.FSharp.Scripting\YaafFSharpScripting.fs:line 1276
--- End of inner exception stack trace ---
at [email protected](String text) in C:\code\FAKE\paket-files\matthid\Yaaf.FSharp.Scripting\src\source\Yaaf.FSharp.Scripting\YaafFSharpScripting.fs:line 1284
at [email protected]IFsiSession-EvalScriptWithOutput(String) in C:\code\FAKE\paket-files\matthid\Yaaf.FSharp.Scripting\src\source\Yaaf.FSharp.Scripting\YaafFSharpScripting.fs:line 1308
at Fake.FSIHelper.runScriptUncached(Boolean useCache, String scriptPath, IEnumerable`1 fsiOptions, Boolean printDetails, CacheInfo cacheInfo, TextWriter out, TextWriter err) in C:\code\FAKE\src\app\FakeLib\FSIHelper.fs:line 471
System.InvalidOperationException: 'NETStandard.Library' already has a dependency defined for 'Microsoft.NETCore.Platforms'.
at NuGet.Manifest.ValidateDependencySets(IPackageMetadata metadata)
at NuGet.Manifest.Validate(Manifest manifest)
at NuGet.Manifest.ReadFrom(Stream stream, IPropertyProvider propertyProvider, Boolean validateSchema)
at NuGet.LocalPackage.ReadManifest(Stream manifestStream)
at NuGet.ZipPackage.EnsureManifest(Func`1 manifestStreamFactory)
at NuGet.ZipPackage..ctor(String filePath, Boolean enableCaching)
at <StartupCode$FSI_0005>[email protected]() in C:\Users\mynkow\Desktop\Reproduce\test.fsx:line 12
Stopped due to error
मैं सभी संभव निर्भरता के 5 नवीनतम संस्करणों के साथ की कोशिश की है और परिणाम बिल्कुल वही हैं => सी # काम कर रहा है, f # नहीं है। क्या आपके पास कोई सुराग है या बस कुछ भी है जिसे आप मुझे ठीक करने की कोशिश करने के लिए सलाह दे सकते हैं?
गंदे समाधान:
यह कैसे Docker.DotNet.2.124.3.nupkg तरह inside
लग रहा है अगर मैं उदाहरण netstandard1.6
सब कुछ काम करता है के लिए निकालते हैं। इसका मतलब है कि समस्या nuget.core
में है, है ना? लेकिन यह सी # कंसोल ऐप में क्यों काम कर रहा है? कोई जानकारी नहीं!
अद्यतन: मैं एफ # सांत्वना आवेदन
क्या आप वाकई दोनों मामलों में 'NuGet' लाइब्रेरी के उसी संस्करण का संदर्भ दे रहे हैं? –
हां, नमूनों में प्रदान किया गया यह स्पष्ट नहीं है लेकिन यह जांचने वाली पहली बात थी। इसके अलावा मैंने प्रत्येक निर्भरता के कई संस्करणों के साथ प्रयास किया है। – mynkow
क्या आप अपनी स्क्रिप्ट को fsi.exe के साथ कॉल करने का प्रयास कर सकते हैं? अगर यह एफएसआई के साथ काम करता है लेकिन नकली नहीं है, तो आप FAKE github रिपोजिटरी पर एक बग लॉग करना चाहेंगे। धन्यवाद! – smoothdeveloper