Unable to start debugging using Visual Studio Tooling for Azure Functions Preview.
Start debugging my newly created Function project in Visual Studio.
Command line arguments of the command prompt started by VS2015: C:\Users\dev\AppData\Local\Azure.Functions.Cli\1.0.0-beta.8\func.exe host start --port 7071 & pause
Starting project and debugger attaches to my function.
Console crashes, call stack:
Autofac.Core.DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = WebScriptHostManager (DelegateActivator), Services = [Microsoft.Azure.WebJobs.Script.WebHost.WebScriptHostManager], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = ExternallyOwned ---> A host ID must be between 1 and 32 characters, contain only lowercase letters, numbers, and dashes, not start or end with a dash, and not contain consecutive dashes.
Parameter name: value (See inner exception for details.) ---> System.ArgumentException: A host ID must be between 1 and 32 characters, contain only lowercase letters, numbers, and dashes, not start or end with a dash, and not contain consecutive dashes.
Parameter name: value
at Microsoft.Azure.WebJobs.JobHostConfiguration.set_HostId(String value)
at Microsoft.Azure.WebJobs.Script.WebHost.WebHostResolver.CreateScriptHostConfiguration(WebHostSettings settings)
at Microsoft.Azure.WebJobs.Script.WebHost.WebHostResolver.EnsureInitialized(WebHostSettings settings)
at Microsoft.Azure.WebJobs.Script.WebHost.WebHostResolver.GetWebScriptHostManager(WebHostSettings settings)
at Microsoft.Azure.WebJobs.Script.WebHost.AutofacBootstrap.<>c__DisplayClass0_0.<Initialize>b__1(IComponentContext ct)
at Autofac.RegistrationExtensions.<>c__DisplayClass5_0`1.<Register>b__0(IComponentContext c, IEnumerable`1 p)
at Autofac.Builder.RegistrationBuilder.<>c__DisplayClass0_0`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p)
at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
--- End of inner exception stack trace ---
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters)
at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters)
at Autofac.Core.Container.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters)
at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance)
at Autofac.ResolutionExtensions.ResolveOptionalService(IComponentContext context, Service service, IEnumerable`1 parameters)
at Autofac.Integration.WebApi.AutofacWebApiDependencyScope.GetService(Type serviceType)
at Autofac.Integration.WebApi.AutofacWebApiDependencyResolver.GetService(Type serviceType)
at Microsoft.Azure.WebJobs.Script.WebHost.DependencyResolverExtensions.GetService[TService](IDependencyResolver resolver)
at Microsoft.Azure.WebJobs.Script.WebHost.WebApiConfig.Initialize(HttpConfiguration config, ScriptSettingsManager settingsManager, WebHostSettings settings, Action`2 dependencyCallback)
at WebJobs.Script.Cli.Actions.HostActions.StartHostAction.<RunAsync>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at WebJobs.Script.Cli.ConsoleApp.<RunAsync>d__4`1.MoveNext()
None.
Visual Studio information:
Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586
Installed Version: Enterprise
Architecture and Modeling Tools 00322-80000-00000-AA393
Microsoft Architecture and Modeling Tools
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.
Microsoft Visual Studio Tools for Applications 2015 00322-80000-00000-AA393
Microsoft Visual Studio Tools for Applications 2015
Visual Basic 2015 00322-80000-00000-AA393
Microsoft Visual Basic 2015
Visual C# 2015 00322-80000-00000-AA393
Microsoft Visual C# 2015
Visual C++ 2015 00322-80000-00000-AA393
Microsoft Visual C++ 2015
Application Insights Tools for Visual Studio Package 7.14.01128.2
Application Insights Tools for Visual Studio
ASP.NET and Web Tools 2015.1 14.1.21111.0
ASP.NET and Web Tools 2015.1
ASP.NET Web Frameworks and Tools 2012.2 4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563
ASP.NET Web Frameworks and Tools 2013 5.2.40314.0
For additional information, visit http://www.asp.net/
Azure App Service Tools v2.9.6 14.0.21129.0
Azure App Service Tools v2.9.6
Azure Data Lake Node 1.0
This package contains the Data Lake integration nodes for Server Explorer.
Azure Data Lake Tools for Visual Studio 2.0.6000.0
Microsoft Azure Data Lake Tools for Visual Studio
Common Azure Tools 1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
DataFactoryProject 1.0
Microsoft Data Factory Package
Fabric.DiagnosticEvents 1.0
Fabric Diagnostic Events
GitHub.VisualStudio 2.1.1.0
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.
JavaScript Language Service 2.0
JavaScript Language Service
JavaScript Project System 2.0
JavaScript Project System
JetBrains ReSharper Ultimate 2016.2.2 Build 106.0.20160913.91321
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2016 JetBrains, Inc.
Microsoft Azure Data Factory Node Node 1.0
Azure Data Factory extension for Visual Studio Server Explorer.
Microsoft Azure HDInsight HQL Service 2.0.6000.0
Language service for Hive query
Microsoft Azure HDInsight Tools for Visual Studio 2.0.6000.0
An integrated development environment for HDInsight application development.
Microsoft Azure Mobile Services Tools 1.4
Microsoft Azure Mobile Services Tools
Microsoft Azure Tools 2.8
Microsoft Azure Tools for Microsoft Visual Studio 2015 - v2.8.40211.2
Microsoft Azure Tools 2.7
Microsoft Azure Tools for Microsoft Visual Studio 2015 - v2.7.30713.1601
Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 2015 - v2.9.41104.6
NuGet Package Manager 3.5.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.
PreEmptive Analytics Visualizer 1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.
SQL Server Data Tools 14.0.61021.0
Microsoft SQL Server Data Tools
ToolWindowHostedEditor 1.0
Hosting json editor into a tool window
TypeScript 1.8.36.0
TypeScript tools for Visual Studio
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\AzureFunctions\Microsoft.AzureFunctions.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>e1df4e05-ae27-487a-8359-e8e66b5b8714</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Removed.Api.Functions</RootNamespace>
<AssemblyName>Removed.Api.Functions</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<ProduceOutputsOnBuild>true</ProduceOutputsOnBuild>
</PropertyGroup>
<Import Project="$(VSToolsPath)\AzureFunctions\Microsoft.AzureFunctions.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
{
"id": "a83a1153be9448afbdfcd2gg652eed32",
"functionTimeout": "00:05:00",
"http": {
"routePrefix": "api"
},
"queues": {
"maxPollingInterval": 2000,
"batchSize": 16,
"maxDequeueCount": 5,
"newBatchThreshold": 8
},
"serviceBus": {
"maxConcurrentCalls": 16,
"prefetchCount": 100
},
"eventHub": {
"maxBatchSize": 1000,
"prefetchCount": 100
},
"tracing": {
"consoleLevel": "verbose",
"fileLoggingMode": "debugOnly"
},
"watchDirectories": [ "Shared", "bin" ],
"singleton": {
"lockPeriod": "00:00:15",
"listenerLockPeriod": "00:01:00",
"listenerLockRecoveryPollingInterval": "00:01:00",
"lockAcquisitionTimeout": "00:01:00",
"lockAcquisitionPollingInterval": "00:00:03"
}
}
@SimonLuckenuik thank you for all the information provided. One quick question. If you don't mind, could you share your machine name (the local machine/host name)? If you don't want to disclose that information, can you verify if it conflicts with the Host ID requirements specified in the exception?
@lindydonna FYI. This may need to be moved to the https://github.com/Azure/Azure-Functions repo.
@fabiocav machine name: SPECTRE-LAPTOP (as returned by the hostname command line)
So it doesn't respect the rule, since it has capital letters only.
@fabiocav This issue technically belongs in https://github.com/Azure/azure-webjobs-sdk-script.
@SimonLuckenuik I think the issue is more likely to be the folder name (which is used to generate the host ID on the command line). Could you provide the foldername where you're launching the CLI?
We have these open issues that are related:
https://github.com/Azure/azure-webjobs-sdk-script/issues/1007
https://github.com/Azure/azure-webjobs-sdk-script/issues/1006
Btw @SimonLuckenuik did you find guidance somewhere that said to file tooling issues here? We have a lot of readmes in various places, so I want to make sure I track down the right place. :)
@lindydonna The Azure Function project I used to start the CLI Path is located here: C:\git\RemovedApi\Removed.Api.Web\
The issue location was from a post on Yammer (Donna Malayeri). I was initially planning on submitting in Azure-Functions (why I have the VS tag in the title), but when I realized while investigating that it was CLI related based on the callstack and cmd line args, I created it here, but forgot to change "Visual Studio" to "CLI" :)
I just filed azure/azure-webjobs-sdk-script#1021 and then found this issue. I also found that if I create the project with no spaces, then it works fine.
@SimonLuckenuik Can you confirm that the the issue is resolved if you remove periods from your project name? If so, please close as this is already tracked by Azure/azure-webjobs-sdk-script#1007 and Azure/azure-webjobs-sdk-script#1006
@lindydonna The dots in the project name have no effect. I kept the dots in the filename, but removed the dots from the folder name in which the project was and it started working in order to have it working.
Awesome, thanks @SimonLuckenuik. Can I close this issue as a duplicate since we have the "dot folder name" issue tracked?
Sure you can close it, thank you for your support.
Closing as duplicate of https://github.com/Azure/azure-webjobs-sdk-script/issues/1006
@lindydonna I mentioned the meta repo because those are the instructions on the blog post (https://blogs.msdn.microsoft.com/webdev/2016/12/01/visual-studio-tools-for-azure-functions/) so you may need to update the forward link (https://go.microsoft.com/fwlink/?linkid=836326), otherwise we'll see them opened in the meta repo instead.
Maybe one general comment, for end-users who are just getting started, it may not be obvious what goes where, it would probably be easier to have everything reported in a central location which is clearly tagged as 'Azure Functions' (eg https://github.com/Azure/Azure-Functions) and move it to the proper repository after. While people may understand that Azure Function leverage WebJobs, it might not be obvious to know which part of the product is affected by a bug/problem. I would not expect people to start looking in multiple repositories to know if the issue they have is already raised or not.
I think they should be centralized under one name. We don't need WebJobs and Functions. They are practically the same.
Most helpful comment
@lindydonna The dots in the project name have no effect. I kept the dots in the filename, but removed the dots from the folder name in which the project was and it started working in order to have it working.