Illegal characters in path : Visual Studio 2019

Viewed 2693

I'm not sure why but I simply just can't run my VS 2019 project(Azure Functions v3 proj) all of a sudden; it shows

Illegal characters in path enter image description here

This is not an issue with the current branch that I'm working with; it's an issue with projects in all the branches. This is also the same path where the project was running successfully all this time. Rebuild , Restart of VS, Re-clone of the project, deleting the contents of the bin and the obj folders and then running again - I have tried everything, but nothing helped. I have also tried repairing and even re-installing VS but it was of no help. The .csproj file looks completely fine to me at least:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <AzureFunctionsVersion>v3</AzureFunctionsVersion>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.ApplicationInsights" Version="2.13.1" />
    <PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.0.0" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="3.0.10" />
    <PackageReference Include="Microsoft.Extensions.Http" Version="3.1.2" />
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.6" />
  </ItemGroup>
  <ItemGroup>
    <None Update="host.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="local.settings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </None>
  </ItemGroup>
</Project>

This post also didn't help: Visual Studio- Illegal characters in path

Any help whatsoever would be very helpful.

1 Answers

Firstly, thanks to all of you for your suggestions to resolve this issue. After spending hours for a fix on this issue(which even included re-installing VS!), I finally chanced upon this life-saver of an article: Visual Studio 2017/2019 fails when I create an Azure Functions project.

The remedy is pretty simple, we just need to remove %localappdata%\AzureFunctionsTools and this would do the magic.

I hope this answer is helpful for all those who would stumble upon this later.

Related