Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

Error while getting the config file parameters in C# console application

$
0
0

I am following this page to encrypt the blob using azure key vault using C#

https://docs.microsoft.com/en-us/azure/storage/blobs/storage-encrypt-decrypt-blobs-key-vault?WT.mc_id=Portal-Microsoft_Azure_Support&tabs=dotnet11#use-key-vault-secrets

But getting an error in this code block

StorageCredentials creds = new StorageCredentials(                CloudConfigurationManager.GetSetting("accountName"),                CloudConfigurationManager.GetSetting("accountKey")            );

Unhandled exception. System.Runtime.InteropServices.MarshalDirectiveException: Cannot marshal 'parameter #1': Invalid managed/unmanaged type combination (Marshaling to and from COM interface pointers isn't supported).

app.config

<appSettings><add key="accountName" value="myaccount"/><add key="accountKey" value="theaccountkey"/><add key="clientId" value="theclientid"/><add key="clientSecret" value="theclientsecret"/><add key="container" value="stuff"/></appSettings>

I tried the solutions given in link below, but those didn't work either

System.argumentnullexception is null using microsoft azure storage


Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>