开发者

Issue with appSettings using 2 different projects

开发者 https://www.devze.com 2023-01-10 11:00 出处:网络
I\'ll try to do my best to explain my problem. I have 2 separate projects which are par开发者_StackOverflow中文版t of the same application in Visual Studio. One of them is server-sided and the other

I'll try to do my best to explain my problem.

I have 2 separate projects which are par开发者_StackOverflow中文版t of the same application in Visual Studio. One of them is server-sided and the other is client-sided.

The client sided project uses an appSettings key called XMLFileName which is used to retrieve data from an XML and populate a dataset with the retrieved info. In this client sided project I have a method that performs some check in the dataset.

When I try to call that method from the server sided project, I can't get the dataset populated since the XMLFileName isn't being read by the server sided project due to it not being defined in its application settings. If I hardcode the file name string on the server sided project it won't find it since it looks in a different folder.

How should I proceed with this? Am I being clear enough?

Thanks, Eton B.


Why not just add the same setting to the server-side project? Am I missing something?


I may not understand the problem completely, but it sounds like you have two different applications (client and server) using the same method (e.g. GetXmlFile()) to retrieve the same file (File.xml). If that's the case, then you probably need to have the XML file on a shared drive that can be accessed by a UNC path (e.g. `\myclient\XMLFiles\File.xml').

If that is the scenario, can you change the method GetXmlFile() to use a UNC path to access the file, and to store a UNC path and file name in your appSettings?

If I'm mis-understanding the situation, please let me know and I'll update my answer accordingly.

Hope this helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消