Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specifying connection file in code is neglected #11

Open
rappen opened this issue Apr 5, 2016 · 6 comments
Open

Specifying connection file in code is neglected #11

rappen opened this issue Apr 5, 2016 · 6 comments
Labels

Comments

@rappen
Copy link

rappen commented Apr 5, 2016

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.

@MscrmTools
Copy link
Owner

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

@MscrmTools MscrmTools added the bug label Sep 24, 2016
MscrmTools added a commit that referenced this issue Sep 24, 2016
@rappen
Copy link
Author

rappen commented Sep 26, 2016

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.

@MscrmTools MscrmTools reopened this Sep 26, 2016
@MscrmTools
Copy link
Owner

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

@rappen
Copy link
Author

rappen commented Sep 26, 2016

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

@MscrmTools
Copy link
Owner

Does it still happen?

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

@rappen
Copy link
Author

rappen commented Jun 18, 2018

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants