MscrmTools.Xrm.Connection
MscrmTools.Xrm.Connection copied to clipboard
Specifying connection file in code is neglected
Specifying a connection file in code does not work anymore, if the connection file does not exist in the connectionlist file.
I use the following code to make sure connection file is stored in proper appdata folder:
var configpath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), AppName);
if (!Directory.Exists(configpath))
{
Directory.CreateDirectory(configpath);
}
ConnectionManager.ConfigurationFile = Path.Combine(configpath, "Connections.config");
But that file is no longer used when starting the program. Related to #2.
I can fix this but it will automatically add the specific connection file in the file that stores connections list
These two lines works for the ConnectionList file, but not for the Connections file:
ConnectionsList.ConnectionsListFilePath = Path.Combine(configpath, "ConnectionList.xml"); ConnectionManager.ConfigurationFile = Path.Combine(configpath, "Connections.config");
The resulting ConnectionsList.xml looks like this:
<?xml version="1.0" encoding="utf-8"?>
<ConnectionsList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Files>
<ConnectionFile>
<LastUsed>0001-01-01T00:00:00</LastUsed>
<Name>Default</Name>
<Path>C:\Users\jora\AppData\Roaming\Cinteros CRM Deployer\mscrmtools2011.config</Path>
</ConnectionFile>
</Files>
</ConnectionsList>
So it seems something is still missing to make it accept the given file name for the connections file.
Ok, still have some work to do so...
When specifying a ConnectionsListFilePath, I have to create a default file but it seems adding a new file does not work
A bit more info:
My connections file Connections.xml
is created with the connections I supply, and when I restart the program that file is read so my connections are available.
But the ConnectionList.xml
file still refers to the mscrmtools2011.config
file.
So mayby the problem is just "behind the scenes"...
Does it still happen?
(I know... it's a long time...)
This was from working with our CRM Shuffle Deployer, I have not looked into it for quite some time now. Maybe @KhashRastin would like to test this again, if still relevant?