ConnectionString Issue
Is there an existing issue for this?
- [X] I have searched the existing issues
Description
ABP studio accepts only a single backslash ("") when you are assigning a connection string (SQL server). This produces problem since in appsettings.json, the connection string should have double backslash ("\").
Version
Community edition v0.9.21
Operation System
Windows (Default)
Solution Configuration
No response
Other information
No response
When you define the connection string it directly tries to connect to the database with the specified connection string. However, in your code, it should be as double backslash, because one of them acts as an escape character (). This is not related to ABP Studio, if you would create a normal application and try to define it without double backslash, you would still get the same problem.
Hello, I don't think you understand the issue. The issue is that the studio does not accept the connection string with double backslash and when you continue with the migration there, it produces an error. Sure we can always replace connection strings in the code or appsettings.json. But the point is, this is a studio and generation bug which does not happen before.
With the previous version of studio, and when you first generate a solution there, it assigns a localDB connection string which has a double backslash. Now when you proceed with that, it now produces an error that I have attached (see screen shots). You have to replace the double backslash to a single one inorder to proceed. But in the end when it is already running migration, it throws that error since it uses an invalid connection string with a single backslash that C# does not accept.
See the difference below:
Hello, I don't think you understand the issue. The issue is that the studio does not accept the connection string with double backslash and when you continue with the migration there, it produces an error. Sure we can always replace connection strings in the code or appsettings.json. But the point is, this is a studio and generation bug which does not happen before.
With the previous version of studio, and when you first generate a solution there, it assigns a localDB connection string which has a double backslash. Now when you proceed with that, it now produces an error that I have attached (see screen shots). You have to replace the double backslash to a single one inorder to proceed. But in the end when it is already running migration, it throws that error since it uses an invalid connection string with a single backslash that C# does not accept.
Sorry, It seems I misunderstood. When you define \\ with localdb, we're replacing the double backsplash for checking the related server, however, we did not do this for other servers. I'll create an internal issue for that.
Okay, thank you. :)
Created the issue in our internal repository (with tracking-number 2572), and it will be fixed with the next ABP Studio release. Thanks for reporting this problem.