首页 > 解决方案 > Visual Studio 2019 无法运行 Azure Function 项目或创建新项目

问题描述

我很幸运,当 Visual Studio with Azure Function 项目打开时,我的电脑突然崩溃了。在那之后,我既不能运行这个项目,也不能创建一个新的 Azure Function 项目,因为同样的错误是“路径中的非法字符”。同时,可以毫无问题地创建和运行其他类型的项目。

我试图重新安装 VS 和所有 .net 包,但没有运气。我能以某种方式定位问题吗?所以我可以替换一些有问题的 DLL 或其他东西,而无需安装新的 Windows。

这是我设法从 VS 日志中检索到的错误文本:

System.ArgumentException: Illegal characters in path.at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)at System.IO.Path.Combine(String path1, String path2)at Microsoft.WebTools.Azure.Client.FunctionsFeed.FeedDataProvider.DemandReleaseDirectory(String releaseName)at Microsoft.WebTools.Azure.Client.FunctionsFeed.FeedDataProvider.TryGetLastKnownGoodToolsetForTag(IFeedTag tag, IToolset& toolset)at Microsoft.WebTools.Azure.Functions.TemplateEngine.UI.FeedHelpers.GetFrameworkForTag(IFeedDataProvider feedDataProvider, IFeedTag tag, IFileSystem fileSystem, Task`1& loadTask)at Microsoft.WebTools.Azure.Functions.TemplateEngine.UI.FeedHelpers.GetRuntimeFrameworks(IFeedDataProvider feedDataProvider, IEnvironment environment, IFileSystem fileSystem, Task`1& loadTask, IEnumerable`1& toolsetLoadTasks)at Microsoft.WebTools.Azure.Functions.TemplateEngine.UI.FunctionProjectViewModel.InitializeRuntimeFrameworkList()at Microsoft.WebTools.Azure.Functions.TemplateEngine.UI.FunctionProjectViewModel..ctor(IThreadSwitcher threadSwitcher, IFileSystem fileSystem, IVsWrappersFactory vsWrappers, IEngineBootstrapper bootstrapper, IProjectCreationMetadata metadata, IFeedDataProvider feedDataProvider, IEnvironment environment, IFunctionsRuntimeManager runtimeManager, IFunctionsProjectSettings settings)at Microsoft.VisualStudio.TemplateEngine.FunctionProjectCreator.ShowTemplateUI(IProjectCreationMetadata metadata, IReadOnlyDictionary`2 passthroughParams)at Microsoft.VisualStudio.TemplateEngine.Wizard.TemplateWizardProjectPipeline.TryInvokeUICore(IProjectCreationMetadata metadata)

标签: azure-functionsvisual-studio-2019

解决方案


也许这是一个已知问题,有一个关于它的博客,你可以试试这个解决方案:blog

删除此文件夹:%localappdata%/AzureFunctionsTools


推荐阅读