问题
My code in VS2015 ultimate is:
BrowserWindow browser = BrowserWindow.Launch(ConfigurationManager.AppSettings["URL"]);
While using this code I'm getting error in the code and when I mouse hovered it I got this 'object' does not contain a definition for "AppSettings" and no extension method 'AppSettings' accepting a first argument of type object could be found(are you missing a using directive or an assembly reference?)
.
But I have provided using System.Configuration;
. And this code was working perfectly in VS2012 ultimate. Can anyone provide me a solution for this issue?
回答1:
I got the solution, I used this code
BrowserWindow.Launch(System.Configuration.ConfigurationManager.AppSettings["URL"]);
Also, I added System.configuration
to the References. It then worked.
来源:https://stackoverflow.com/questions/53414794/im-unable-to-use-configurationmanager-appsettings-in-coded-ui