build error if the project name has dash in it
See original GitHub issueusing 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:
- Created 4 years ago
- Comments:5 (3 by maintainers)

Top Related StackOverflow Question
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!
Addressed in v3.0.4-beta1. Thanks!