I have introduced a new web.config transform as web.test.config. But when I am running the application the values are still coming from Web.config file.
I followed the below article:
and made the necessary changes.
Web.test.config
Web.config
Read: ConfigurationManager.AppSettings["TestKey"];
I want to get the value from Web.config when I run as debug mode and want to get the value from web.test.config when I run as test configuration mode.
You can not run the application in test configuration mode in Visual Studio if that's what your meaning. You have to publish the app in test mode to get the transformation. Aka you can test your app in i.e IIS with your test configuration, but not directly in VS. You can however preview the transformation in VS.