ctripcorp / dal

Ctrip Database Access Layer
Apache License 2.0
1.24k stars 447 forks source link

using DAL to Web project that configs file can't be founded. #21

Closed DaqingFeng closed 7 years ago

DaqingFeng commented 7 years ago

When the project is website. The project directory can't be resolve correctly. The issue i found just make a little adjust. So it can be fix. Please see like below. '

File:

 DefaultConnectionString

Fixed Code:

  String filepath = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, configPath);
                using (var stream = new FileStream(filepath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
                {
wangyenan commented 7 years ago

Accepted.

wangyenan commented 7 years ago

Issue fixed,thanks for the info.