MscrmTools.Xrm.Connection icon indicating copy to clipboard operation
MscrmTools.Xrm.Connection copied to clipboard

Specifying connection file in code is neglected

Open rappen opened this issue 8 years ago • 6 comments

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.

rappen avatar Apr 05 '16 07:04 rappen

I can fix this but it will automatically add the specific connection file in the file that stores connections list

MscrmTools avatar Sep 24 '16 13:09 MscrmTools

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.

rappen avatar Sep 26 '16 08:09 rappen

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

MscrmTools avatar Sep 26 '16 08:09 MscrmTools

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"...

rappen avatar Sep 26 '16 08:09 rappen

Does it still happen?

(I know... it's a long time...)

MscrmTools avatar May 30 '18 06:05 MscrmTools

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?

rappen avatar Jun 18 '18 19:06 rappen