General information
Category:
Entity Framework
Environment versions
Network:
Windows 2008 Server
>>Hi All,
>>
>>We are migrating an application from VFP to C#. One of the directives for the project is to maintain a common code base whenever possible. As we rewrite into C# we are producing DLLs to be used for data access and as a middle tier. We are looking to migrate portions of the legacy VFP app to using the C# DLLs as well go to only have to maintain a single code set. This can be accomplished by setting up the DLL classes as COM objects and this part works and the classes are available in VFP.
>>
>>The COM item I am looking to use in a basic data import. When the COM object reaches the point of connecting to the data via the enitity framework I recieve an error that the connection name cannot be found in the app.config file. The import runs just fine in C#, but fails via COM.
>>
>>Documentation that I have found indicates that DLLs cannot support a config file and that it instead relies on the web.config file of the consuming project. As I am calling the objects via COM there isn't a web.config in the parent project.
>>
>>Is anyone aware of a better way to do this?
>
>Add an app.config file to the dll project and specify the connection string there.
>
>Or programmatically pass the connection string as a parameter to the entity constructor...
The project has an app.config, but at run-time it is ignored in favor of a web.config. In a COM object scenario there isn't a web.config. I will try passing the string through and see if the result is different. They removed where the DLL looks for dllname.DLL.CONFIG as a file and I was hoping for a replacement.
Thanks.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only