ThinkGeo.com    |     Documentation    |     Premium Support

Server Test License displaying "The file specified does not exist." on our test site

Hi ThinkGeo Forum,

We recently installed the Test License to our server and are receiving an error over the tiles for our shapefiles we are adding to the LayerOverlay. I have verified that the folder referenced is being called correctly and we have code in placed that if the file is not found that our own error message would appear. Is there something we are missing with the server installation process?

Thank you,

Neil

Hi Neil,

If that’s a license issue, it won’t shows the “the file specified does not exist”.

I think you can try that like this:

Build a very simple sample only contains the shape file render logic, you can create it quickly follow this guide http://wiki.thinkgeo.com/wiki/map_suite_project_template_guide

Please make sure to modify the shape file path just like your project is using, and did a quickly test. If it still shows this exception, the file path maybe have problem, try to change it and see whether that works.

If that’s not the shape file path problem, please create a sample which can reproduce it, our developer can help you look into it.

Regards,

Ethan

Hi Ethan,

Thank you for your suggestions. I will look into building a sample for you of this project. Also we have verified the file path is correct. In addition, we have done some debugging into this issue. We found the issue occurs both locally and on our server due to how we are impersonating the forms.

Our lead web developer said, “If we change the application pool in IIS, to use our impersonation account as the Identity for the Application Pool, it all works. However, we don’t want to use our impersonation account for the whole website as it has access to network resources.”

Currently we are Impersonating the needed forms individually in the Web.config such as:

> <location path="Forms/GISToolbox/GISReporting">
> 	<system.web>
> 		<identity impersonate="true" userName="userName" password="password" />
> 	</system.web>

Whenever we do this we can access and verify the path exists for the shapefiles in our forms. Consequently it seems the dlls are not within the scope of the impersonation and hence not able to verify the shapefiles filepath exists (Screenshot of the file does not exist error over the map: https://www.screencast.com/t/RyJTqUeLu).

Do you have a suggestion to use impersonation for individual forms that will work within the scope of the dlls?

Thank you,

Neil

Hi Neil,

Based on your information, I guess this issue is caused that your project cannot access this shape file with identity mode.

You can create one simple project without MapSuite dlls to access the shape file, in this sample, you can try to access the shape file just with File.Open(). I supposed that you can get the same exception message. If so, we think you should check the shape file is accessible when using identity mode in your project.

Hope this make sense for you. If there is still any issue, please feel free to let us know that.

Thanks
Mark

Hi Mark,

Thank you for the suggestion. We have set up a test project to match all the IIS and various other setting to our local project. We made sure our virtual machine and references were the same. In the test project we added simple labels to report back if the file existed and if the open succeeded. With Identity impersonate set to true for the specific form we received these messages https://www.screencast.com/t/htUu9RcBc. Without the identity code we receive the messages https://www.screencast.com/t/fnabVbMy.

Here is our code for testing this.

try
            {
                if (!Page.IsPostBack)
                {
                    string strFile = @"Our Virtual Machines File Path";

                    if (File.Exists(strFile))
                        lblExists.Text = "File Exists";
                    else
                        lblExists.Text = "File Does Not Exist";

                    File.Open(strFile, FileMode.Open);

                    lblSuccess.Text = "Open Succeeded!";
                }
            }
            catch (Exception ex)
            {
                lblSuccess.Text = ex.Message;
            }

We have verified also in our local project that the files do exist and are able to open. Is there anything else we can try? \

Thanks,

Neil

Hi Neil,

Because we hadn’t reproduce your problem, so we try to find the reason of that. Could you please try this solution from internet:

Add the alwaysFlowImpersonationPolicy element: http://msdn.microsoft.com/en-us/library/ms229553.aspx

You should want to find the config file in the path like this: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Aspnet.config

Set alwaysFlowImpersonationPolicy = true and legacyImpersonationPolicy = false:

The sample:

Please let me know whether that’s works.

Regards,

Ethan

Hi Ethan,

We attempted your suggestions which didn’t seem to work so our lead web developer changed the website to run under a custom application pool identity account. This fixed our issue and the shapefiles are correctly displaying now. Thank you for the help and suggestions.

Regards,

Neil

Hi Neil,

I am glad to hear you solved that, and thanks for your update, that’s should be helpful if who met the same problem.

Regards,

Ethan