question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

A comment precisely constructed with a hyperlink immediately after the // on the same line as your #addin preprocessor directive when just using the Package Name causes nuget to fail to find the package.

See original GitHub issue

What You Are Seeing?

When I construct my addin directive with a comment that is a hyperlink and it immediately follows the // and is on the same line as the #addin and uses the package name only like below:

#addin "Cake.WebDeploy" //https://github.com/SharpeRAD/Cake.WebDeploy

Produces the following command line messages:

Installing addins....
Unable to find package 'Cake.WebDeploy'
Nuget exited with 1
Could not find any assemblies compatible with .NETFramework,Version=v4.5

If the comment is not a hyperlink OR does not immediately start as a hyperlink in the comment, it works.

#addin "Cake.WebDeploy" // https://github.com/SharpeRAD/Cake.WebDeploy => works, noting a space immediately following the //
#addin "Cake.WebDeploy" //see https://github.com/SharpeRAD/Cake.WebDeploy => works
#addin "Cake.WebDeploy" //allows for web deploy client installation usage => works

Move the comment above the #addin directive, works.

//https://github.com/SharpeRAD/Cake.WebDeploy
#addin "Cake.WebDeploy"

If I use the longer version of the directive that gives the package URI with the comment on the same line it works.

#addin nuget:?package=Cake.WebDeploy&version=0.1.9 //https://github.com/SharpeRAD/Cake.WebDeploy

What version of Cake are you using?

0.17.0

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?

Not yet. 😃

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

using a build.cake constructed like:

#addin Cake.WebDeploy //https:github.com/SharpeRAD/Cake.WebDeploy repo has usage samples
//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////

var target = Argument("target", "Default");
var configuration = Argument("configuration", "Debug");

with just build task that runs MSBUILD and executed as .\build.ps1 -t build

Output Log

Using the diagnostic logging level produces:

Installing addins...
Creating directory C:/Projects/TestProject/tools/Addins
Installing NuGet package Cake.WebDeploy...
Executing: "C:/Projects/TestProject/tools/nuget.exe" install "Cake.WebDeploy" -OutputDirectory "C:/Projects/TestProject/tools/Addins" -Source "file://github.com/SharpeRAD/Cake.WebDeploy/" -ExcludeVersion -NonInteractive -NoCache
NuGet exited with 1
Feeds used:
  file://github.com/SharpeRAD/Cake.WebDeploy/

Output:

Feeds used:
  file://github.com/SharpeRAD/Cake.WebDeploy/

Could not find any assemblies compatible with .NETFramework,Version=v4.5.

With the diagnostic level turned on the command line also produces:

Preparing to run build script...
Running build script...
Unable to find package 'Cake.WebDeploy'
Error: Cake.Core.CakeException: Failed to install addin 'Cake.WebDeploy'.
   at Cake.Core.Scripting.ScriptProcessor.InstallAddins(ScriptAnalyzerResult ana
lyzerResult, DirectoryPath installPath)
   at Cake.Core.Scripting.ScriptRunner.Run(IScriptHost host, FilePath scriptPath
, IDictionary`2 arguments)
   at Cake.Commands.BuildCommand.Execute(CakeOptions options)
   at Cake.CakeApplication.Run(CakeOptions options)
   at Cake.Program.Main()

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
klabranchecommented, Nov 17, 2016

Y’all are awesome! Keep up the great work!

2reactions
patriksvenssoncommented, Nov 17, 2016

Thank you! Didn’t see your previous comment until now (answered on my phone) 😄

We could definitely make the preprocessor parsers more strict which would remove any future confusion. Let’s keep the issue open so we don’t forget it.

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nuget keyword not respecting nuget.config, project location ...
Hi. I'm currently evaluating premake 5 as a possible new build system at work. So far I'm liking it lots. I'm having some...
Read more >
cakebuild - How can I use #define to load tasks?
The addin as well as the tasks are packaged within a NuGet package. Now I would like to update the used Cake version...
Read more >
C# preprocessor directives
Learn the different C# preprocessor directives that control conditional compilation, warnings, nullable analysis, and more.
Read more >
Preprocessor Directives
Preprocessor directives are not required or available when running with Cake Frosting. Addin directive, Directive to install and reference addins using NuGet.
Read more >
Bug listing with status RESOLVED with resolution OBSOLETE ...
... Bug:77499 - "ll-url-0.14.ebuild (New Package)" status:RESOLVED ... to control vdr via its svdrp-protocoll" status:RESOLVED resolution:OBSOLETE severity: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found