Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addin Framework parsing fails #1328

Open
aateeque opened this issue Oct 29, 2016 · 9 comments
Open

Addin Framework parsing fails #1328

aateeque opened this issue Oct 29, 2016 · 9 comments

Comments

@aateeque
Copy link
Contributor

What You Are Seeing?

Error: System.InvalidOperationException: Something went wrong when parsing framework.

What is Expected?

Script should run withour error

What version of Cake are you using?

Version 0.16.2+Branch.main.Sha.fb23be463dacfa51c9b19a7cd111149dda7e8c6b

Are you running on a 32 or 64 bit system?

64-bit

What environment are you running on? Windows? Linux? Mac?

Windows 7

Are you running on a CI Server? If so, which one?

No

How Did You Get This To Happen? (Steps to Reproduce)

Attaching debugger to a script that installs any Cake Addin. I am using VS Code and have tried with Visual Studio too

Output Log

Error: System.InvalidOperationException: Something went wrong when parsing framework.
   at Cake.NuGet.V3.NuGetV3ContentResolver.ParseFromDirectoryPath(NuGetFramework current, DirectoryPath path)
   at Cake.NuGet.V3.NuGetV3ContentResolver.GetAddinAssemblies(DirectoryPath path)
   at Cake.NuGet.NuGetContentResolver.GetFiles(DirectoryPath path, PackageReference package, PackageType type)
   at Cake.NuGet.NuGetPackageInstaller.Install(PackageReference package, PackageType type, DirectoryPath path)
   at Cake.Core.Scripting.ScriptProcessor.InstallAddins(ScriptAnalyzerResult analyzerResult, DirectoryPath installPath)
   at Cake.Core.Scripting.ScriptRunner.Run(IScriptHost host, FilePath scriptPath, IDictionary`2 arguments)
   at Cake.Commands.DebugCommand.Execute(CakeOptions options)
   at Cake.CakeApplication.Run(CakeOptions options)
   at Cake.Program.Main()
@devlead
Copy link
Member

devlead commented Oct 29, 2016

@aateeque how does the #addin directive/in you build.cake

@aateeque
Copy link
Contributor Author

@devlead I have #addin nuget:?package=Cake.ReSharperReports&version=0.3.1. Same if I replace that package with Cake.AliaSql for example

@bjorkstromm
Copy link
Member

You mentioned using VS Code for debugging, you are the using Cake.CoreCLR and not Cake, am I correct?

AFAIK, Cake.ReSharperReports and Cake.AliaSql are .NET 4.5 packages, and does not then work with .NET Core...

@aateeque
Copy link
Contributor Author

@mholo65 I have tried compiling & running latest master in VS 2015 and observe the same behaviour

@patriksvensson
Copy link
Member

@aateeque Do you have a cake.config configuration file? How are you executing the build? Are you using Cake.CoreClr or Cake package?

@gep13
Copy link
Member

gep13 commented Oct 30, 2016

@aateeque can you point us at at complete reproduction of this issue. I.e. Complete cake and bootstrapper you are using, and any other related files.

@aateeque
Copy link
Contributor Author

aateeque commented Oct 30, 2016

To narrow down the problem, I have just got #addin nuget:?package=Cake.AliaSql in my .cake file which I pass in visual studio debug as app arg.

The exception occurs in the Install Addins step in ScriptRunner.Run(). Specifically, in NugetV3ContentResolver line 49 the assembly.Path.FullPath passed in is C:/dev/code/cake/cake/src/Cake/bin/Debug/Addins/Cake.AliaSql/Cake.AliaSql.dll and
path.GetRelativePath(...) returns relative.FullPath with Cake.AliaSql.dll.

I am sure there is a good reason, but intuitively shouldn't that relative.FullPath be the same as assembly.Path.FullPath passed earlier?

@patriksvensson
Copy link
Member

patriksvensson commented Oct 30, 2016

@aateeque No, it should be the relative path. The error is exactly what it says, it cannot parse the framework from the addin path. The AliasSQL NuGet package does not follow the naming conventions which should be something like lib/net45/Cake.AliaSql.dll.

@aateeque
Copy link
Contributor Author

@patriksvensson that makes sense then! Thanks.
Could we change that to a more meaningful message perhaps? "Expected to find TFM in package path, but found none."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants