What a deal with | variables in connection strings?

I know that | DataDirectory | will be resolved to App_Datain the ASP.NET application, but it is hard-coded or there is a generalized mechanism working along the lines of% environment variables%

+3
source share
1 answer

From the MSDN Smart Client Data Blog :

In this version, the .NET runtime has added support for what we call a DataDirectory Macro. This allows Visual Studio to put a special variable in the connection string, which will expand at runtime ...

By default | DataDirectory | the variable will be expanded as follows:

  • , , (.exe).
  • , ClickOnce, ClickOnce
  • - App_Data​​li >

| DataDirectory | . , :

AppDomain.CurrentDomain.SetData("DataDirectory", newpath)
+5

Source: https://habr.com/ru/post/1696429/


All Articles