0

I keep getting this exception on the build.

it stops at this line:

IConfigurationRoot config = builder.Build();

and gives this exception:

System.IO.FileNotFoundException: 'Could not load file or assembly 'Microsoft.Azure.AppConfiguration.AzconfigClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=69dad7634abb75e4' or one of its dependencies. The system cannot find the file specified.'

I have tried to add this reference in the packages.config :

<package id="Microsoft.Azure.AppConfiguration.AzconfigClient" Version="1.0.0-preview-008870001-1052" targetFramework="net472"/>

but it still do not work.

var builder = new ConfigurationBuilder(); //new config builder
            builder.AddAzureAppConfiguration(Environment.GetEnvironmentVariable("ConnectionString")); //get the connecting string

IConfigurationRoot config = builder.Build(); //call the build method in config builder

I am expecting it to build so that I can use the config variable.

Thomas
  • 24,234
  • 6
  • 81
  • 125
Byusa
  • 2,279
  • 1
  • 16
  • 21
  • When you are running your application the assembly and its required files should be in your bin/Debug or Release folder . What you have to do is to open the references section in your project, right click on the reference and it will open the property section and set the **Copy Local** to true. For additional reference [how-to-resolve-the-could-not-load-file-or-assembly-issues-on-windows-azure-web-sites](https://blogs.msdn.microsoft.com/asiatech/2013/01/09/how-to-resolve-the-could-not-load-file-or-assembly-issues-on-windows-azure-web-sites/) – Ashok Manghat Jul 20 '19 at 03:54

1 Answers1

0

You can install Microsoft.Extensions.Configuration.AzureAppConfiguration which is support .net standard project. For .net it is preview.

Here is a tutorial you could refer to.

Joey Cai
  • 18,968
  • 1
  • 20
  • 30