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.

build error if the project name has dash in it

See original GitHub issue

using vscode I have created a function app with name “azdeployer-api”. following your example I have created FunctionAppConfiguration.cs, a command DeployTemplateCommand.cs and a command handler DeployTemplateCommandHandler.cs. It fails with below error

Unhandled Exception: FunctionMonkey.ConfigurationException: CS0116:A namespace cannot directly contain members such as fields or methods SourceFile([443..452))CS0116:A namespace cannot directly contain members such as fields or methods SourceFile([381..390))CS0116:A namespace cannot directly contain members such as fields or methods SourceFile([266..275))CS1514:{ expected SourceFile([438..439))CS1022:Type or namespace definition, or end-of-file expected SourceFile([454..455))CS1514:{ expected SourceFile([261..262))CS1022:Type or namespace definition, or end-of-file expected SourceFile([277..278))CS1514:{ expected SourceFile([376..377))CS1022:Type or namespace definition, or end-of-file expected SourceFile([392..393))
     at FunctionMonkey.Compiler.Implementation.AssemblyCompiler.CompileAssembly(IReadOnlyCollection`1 syntaxTrees, IReadOnlyCollection`1 externalAssemblyLocations, OpenApiOutputModel openApiOutputModel, String outputBinaryFolder, String outputAssemblyName, String assemblyNamespace, TargetEnum target)
     at FunctionMonkey.Compiler.Implementation.FunctionCompiler.Compile() in D:\wip\myOpenSource\functionMonkey\Source\FunctionMonkey.Compiler\Implementation\FunctionCompiler.cs:line 86
     at FunctionMonkey.Compiler.Program.Main(String[] args) in D:\wip\myOpenSource\functionMonkey\Source\FunctionMonkey.Compiler\Program.cs:line 47
  /var/folders/dq/_qnynrwx3470y8wzy4w63ll1px_yqt/T/tmpec9acaa42b4e4065a95663ef81367e2a.exec.cmd: line 2: 19711 Abort trap: 6           dotnet "/Users/rjanjya/.nuget/packages/functionmonkey.compiler/1.1.2/build/netstandard1.0/../../tools/netcoreapp2.1/FunctionMonkey.Compiler.dll" "/Users/rjanjya/repos/azdeployer-api/bin/Debug/netcoreapp2.1/bin/azdeployer-api.dll" --netcore21
/Users/rjanjya/.nuget/packages/functionmonkey.compiler/1.1.2/build/netstandard1.0/FunctionMonkey.Compiler.targets(21,5): error MSB3073: The command "dotnet "/Users/rjanjya/.nuget/packages/functionmonkey.compiler/1.1.2/build/netstandard1.0/../../tools/netcoreapp2.1/FunctionMonkey.Compiler.dll" "/Users/rjanjya/repos/azdeployer-api/bin/Debug/netcoreapp2.1/bin/azdeployer-api.dll" --netcore21" exited with code 134. [/Users/rjanjya/repos/azdeployer-api/azdeployer-api.csproj]

Build FAILED.

/Users/rjanjya/.nuget/packages/functionmonkey.compiler/1.1.2/build/netstandard1.0/FunctionMonkey.Compiler.targets(21,5): error MSB3073: The command "dotnet "/Users/rjanjya/.nuget/packages/functionmonkey.compiler/1.1.2/build/netstandard1.0/../../tools/netcoreapp2.1/FunctionMonkey.Compiler.dll" "/Users/rjanjya/repos/azdeployer-api/bin/Debug/netcoreapp2.1/bin/azdeployer-api.dll" --netcore21" exited with code 134. [/Users/rjanjya/repos/azdeployer-api/azdeployer-api.csproj]
    0 Warning(s)
    1 Error(s)

I also have that helloworld example from your blog which is working fine but not this one. Error message is also not helpful because I have namespaces, classes and methods created correctly.

skeptical about the name I have now created a new project without dash in its name . azdeployerapi. it has the same configuration, command and command handler files inside it. This one builds succesfully without any issue. so I guess having dash (-) in its name is causing a project not to build. Please look into it.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JamesRandallcommented, Mar 25, 2019

Thanks for reporting this - I think I might know what’s going on, I think its using the project name for a namespace in the generated code hence the confusing error message. I’ve got a new release going out tomorrow so I’ll aim to get a fix in that.

Thanks again!

0reactions
JamesRandallcommented, Jul 14, 2019

Addressed in v3.0.4-beta1. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

what should I do if the project name contains hyphen in rust
I am a newbie of rust, when I tried to write a rust web api, but the project contains hyphen so I could...
Read more >
EAS build fails if project name has dashes (and has `expo- ...
Summary If the project name (expo.name in app.json) has dashes - (for example: my-project), it fails to build with the expo-sentry package, ...
Read more >
Creating a project with a hyphen in the name (-)
Creating a project with a hyphen in the name (-), all created files will be bugged - Developer Community.
Read more >
Special characters in project name/path prevent users from ...
If a user has a branch name that includes special characters and attempts to build an image from GitLab's CI/CD product, it will...
Read more >
File names containing dash
I ask because my organization's project numbers (surprise!) start with numbers, and it would make sense to start file names with the project...
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