Linq DataContext Problem
I have this strange problem on Linq DataContext.
So I have instantiated my data context and have it use the connection string from the config.
This is wcf service by the way, and I have it hosted on IIS.
when I do a call on any of the methods from my service using Test Client, it will work but If I call any method using POST or Get request it will throw an sql exception that says "it can't connect with the user....". So when I look at the context instance it uses my old connectio开发者_如何学Cn string that doesn't exist anymore. So I did a search on the entire solution for the instance of connection string but found nothing.
Should you have experience same problem, let me know.
Best
If you are using IIS7 you can check what connection string is being used by clicking the connection strings icon. See if it still exists. If that's the case check your solutions properties to make sure that the build action is set to content, and the Copy to Output Directory is set at least to copy if newer.
My second guess would be to check if the folder containing your files allows access to the Network Service user, or IUSR depending on which IIS is using.
精彩评论