# Issue with Relative Paths in SDK version 3.3.4

**URL:** <https://zatca1.discourse.group/t/issue-with-relative-paths-in-sdk-version-3-3-4/2574>\
**Category:** SDK, web-based validator and sandbox\
**Created:** [August 24, 2024, 11:45am UTC](https://zatca1.discourse.group/t/issue-with-relative-paths-in-sdk-version-3-3-4/2574 "2024-08-24T11:45:23Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![mekhlafy](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@mekhlafy](https://zatca1.discourse.group/u/mekhlafy)\
**Post date:** [August 24, 2024, 11:45am UTC](https://zatca1.discourse.group/t/issue-with-relative-paths-in-sdk-version-3-3-4/2574/1 "2024-08-24T11:45:23Z")

</div>

I hope you’re doing well. We’re currently working on integrating the latest version of your SDK and have encountered an issue related to the use of relative paths within the library.

for those files where in the library they should exist 3 folders back. where in our project the data folder would be in the same project binaries

- 20210819\_ZATCA\_E-invoice\_Validation\_Rules.xsl
- CEN-EN16931-UBL.xsl

What do you suggest as a solution for this ?

---

<div class="post-metadata">

**Author:** ![mekhlafy](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@mekhlafy](https://zatca1.discourse.group/u/mekhlafy)\
**Post date:** [September 2, 2024, 6:38am UTC](https://zatca1.discourse.group/t/issue-with-relative-paths-in-sdk-version-3-3-4/2574/2 "2024-09-02T06:38:23Z")

</div>

Hi everyone,

I just wanted to follow up on my earlier post regarding the issue with relative paths in the SDK integration. I’m still trying to find a solution and would really appreciate any insights or suggestions you might have.

Thanks again for your time and help!

---

<div class="post-metadata">

**Author:** ![mekhlafy](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@mekhlafy](https://zatca1.discourse.group/u/mekhlafy)\
**Post date:** [September 13, 2024, 11:09am UTC](https://zatca1.discourse.group/t/issue-with-relative-paths-in-sdk-version-3-3-4/2574/3 "2024-09-13T11:09:49Z")

</div>

You release 3.3.5 but it still contains relative path issue which makes the integrations hard.

---

<div class="post-metadata">

**Author:** ![mekhlafy](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@mekhlafy](https://zatca1.discourse.group/u/mekhlafy)\
**Post date:** [October 7, 2024, 9:20am UTC](https://zatca1.discourse.group/t/issue-with-relative-paths-in-sdk-version-3-3-4/2574/4 "2024-10-07T09:20:32Z")

</div>

Any clarifications please

---

<div class="post-metadata">

**Author:** ![eCloud](https://dub1.discourse-cdn.com/flex013/user_avatar/zatca1.discourse.group/ecloud/32/629_2.png) [@eCloud](https://zatca1.discourse.group/u/eCloud)\
**Post date:** [October 7, 2024, 10:37am UTC](https://zatca1.discourse.group/t/issue-with-relative-paths-in-sdk-version-3-3-4/2574/5 "2024-10-07T10:37:47Z")

</div>

> [@mekhlafy](#):
>
> for those files where in the library they should exist 3 folders back

I’m guessing you’re talking about .Net8 Zatca.eInvoice.SDK.dll

> [@mekhlafy](#):
>
> where in our project the data folder would be in the same project binaries

> [@mekhlafy](#):
>
> I’m still trying to find a solution and would really appreciate any insights or suggestions you might have

From my testing, v3.3.5 requires external resources as you mentioned.

> [@mekhlafy](#):
>
> You release 3.3.5 but it still contains relative path issue which makes the integrations hard.

I did a little **patch** on .Net8 Zatca.eInvoice.SDK.dll for this issue

From this

```auto
relativePathKSA = @"..\..\..\Data\Rules\schematrons\20210819_ZATCA_E-invoice_Validation_Rules.xsl";
KSA_Schematrons = File.ReadAllText(Path.GetFullPath(Path.Combine(AppDomain.get_CurrentDomain().get_BaseDirectory(), relativePathKSA)));
relativePathEN = @"..\..\..\Data\Rules\schematrons\CEN-EN16931-UBL.xsl";
EN_Schematrons = File.ReadAllText(Path.GetFullPath(Path.Combine(AppDomain.get_CurrentDomain().get_BaseDirectory(), relativePathEN)));

```

to

```auto
relativePathKSA = @"Data\Rules\schematrons\20210819_ZATCA_E-invoice_Validation_Rules.xsl";
KSA_Schematrons = File.ReadAllText(Path.GetFullPath(Path.Combine(AppDomain.get_CurrentDomain().get_BaseDirectory(), relativePathKSA)));
relativePathEN = @"Data\Rules\schematrons\CEN-EN16931-UBL.xsl";
EN_Schematrons = File.ReadAllText(Path.GetFullPath(Path.Combine(AppDomain.get_CurrentDomain().get_BaseDirectory(), relativePathEN)));

```

and made sure all the required resources were copied to the location of the Exe file with

```auto
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
  <Exec Command="xcopy &quot;$(ProjectDir)ikvm&quot; &quot;$(TargetDir)ikvm\&quot; /E /I /Y" />
  <Exec Command="xcopy &quot;$(ProjectDir)Data&quot; &quot;$(TargetDir)Data\&quot; /E /I /Y" />
</Target>

<Target Name="PostPublish" AfterTargets="Publish">
  <Exec Command="xcopy &quot;$(ProjectDir)ikvm&quot; &quot;$(PublishDir)ikvm\&quot; /E /I /Y" />
  <Exec Command="xcopy &quot;$(ProjectDir)Data&quot; &quot;$(PublishDir)Data\&quot; /E /I /Y" />
</Target>

```

In my c# Project file.

Work well on Windows OS.  
**ikvm** folder should from Test Folder _zatca-einvoicing-sdk-238-R3.3.5\Lib\Dot-Net8\Test_

---

<div class="post-metadata">

**Author:** ![mekhlafy](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@mekhlafy](https://zatca1.discourse.group/u/mekhlafy)\
**Post date:** [October 7, 2024, 11:17am UTC](https://zatca1.discourse.group/t/issue-with-relative-paths-in-sdk-version-3-3-4/2574/6 "2024-10-07T11:17:16Z")

</div>

Thank you so much for your reply, I just downloaded the SDK again but I didn’t find the dll you patched. May I know where I can get the patched dll

---

<div class="post-metadata">

**Author:** ![eCloud](https://dub1.discourse-cdn.com/flex013/user_avatar/zatca1.discourse.group/ecloud/32/629_2.png) [@eCloud](https://zatca1.discourse.group/u/eCloud)\
**Post date:** [October 7, 2024, 11:33am UTC](https://zatca1.discourse.group/t/issue-with-relative-paths-in-sdk-version-3-3-4/2574/7 "2024-10-07T11:33:36Z")

</div>

[.NET 8 Zatca eInvoice SDK in Action (github.com)](https://github.com/mabaega/ZatcaWithSDK)

I do not recommend this method.  
I am just giving an example, how this relativePath problem can be solved.

Hopefully in the next release, external resources will no longer be needed like in Release v 3.3.3 for .NetFx4.0

---

<div class="post-metadata">

**Author:** ![mekhlafy](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@mekhlafy](https://zatca1.discourse.group/u/mekhlafy)\
**Post date:** [October 7, 2024, 11:47am UTC](https://zatca1.discourse.group/t/issue-with-relative-paths-in-sdk-version-3-3-4/2574/8 "2024-10-07T11:47:17Z")

</div>

So, what I understand from you is that only the releases in Announcements section are the final ones. and until that time we’re fine

---

<div class="post-metadata">

**Author:** ![eCloud](https://dub1.discourse-cdn.com/flex013/user_avatar/zatca1.discourse.group/ecloud/32/629_2.png) [@eCloud](https://zatca1.discourse.group/u/eCloud)\
**Post date:** [October 7, 2024, 11:50am UTC](https://zatca1.discourse.group/t/issue-with-relative-paths-in-sdk-version-3-3-4/2574/9 "2024-10-07T11:50:19Z")

</div>

There are many additional features in each release, so we should always follow the latest releases, to ensure that the invoices we send are in accordance with the rules applied by Zatca.

---

<div class="post-metadata">

**Author:** ![mekhlafy](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@mekhlafy](https://zatca1.discourse.group/u/mekhlafy)\
**Post date:** [October 7, 2024, 11:52am UTC](https://zatca1.discourse.group/t/issue-with-relative-paths-in-sdk-version-3-3-4/2574/10 "2024-10-07T11:52:32Z")

</div>

Ok, because the one here: [zatca-einvoicing-sdk-238-R3.3.5](https://sadzit.sharepoint.com/:u:/r/ZATCA%20Library/September%202024/zatca-einvoicing-sdk-238-R3.3.5.zip?csf=1&web=1&e=nckgKX) doesn’t include your patched file. and I noticed in the Announcements section you still didn’t announce the latest one.

---

<div class="post-metadata">

**Author:** ![eCloud](https://dub1.discourse-cdn.com/flex013/user_avatar/zatca1.discourse.group/ecloud/32/629_2.png) [@eCloud](https://zatca1.discourse.group/u/eCloud)\
**Post date:** [October 7, 2024, 11:55am UTC](https://zatca1.discourse.group/t/issue-with-relative-paths-in-sdk-version-3-3-4/2574/11 "2024-10-07T11:55:04Z")

</div>

> [@mekhlafy](#):
>
> zatca-einvoicing-sdk-238-R3.3.5 doesn’t include your patched file

Yes, I did my own patch, I modified Zatca.eInvoice.SDK.dll to solve the relativePath issue.

---

<div class="post-metadata">

**Author:** ![mekhlafy](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@mekhlafy](https://zatca1.discourse.group/u/mekhlafy)\
**Post date:** [October 7, 2024, 11:57am UTC](https://zatca1.discourse.group/t/issue-with-relative-paths-in-sdk-version-3-3-4/2574/12 "2024-10-07T11:57:29Z")

</div>

so, should I wait to the one from the link I mentioned earlier, or just use the one you gave me ? and if I have to wait

---

<div class="post-metadata">

**Author:** ![eCloud](https://dub1.discourse-cdn.com/flex013/user_avatar/zatca1.discourse.group/ecloud/32/629_2.png) [@eCloud](https://zatca1.discourse.group/u/eCloud)\
**Post date:** [October 7, 2024, 12:04pm UTC](https://zatca1.discourse.group/t/issue-with-relative-paths-in-sdk-version-3-3-4/2574/13 "2024-10-07T12:04:43Z")

</div>

It’s up to you,

I’m sure the Developers have read this issue, and we should wait for the next release.

.Net8 Zatca.eInvoice.SDK actually **[has no problem](https://zatca1.discourse.group/t/validating-error-when-sign-xml-from-zatca-sdk/3124/3)**, Signing document and validation works well.

But users have difficulty because they have to set the Data folder back 3 steps.

As you said

> [@mekhlafy](#):
>
> You release 3.3.5 but it still contains relative path issue which makes the integrations hard.

---

<div class="post-metadata">

**Author:** ![anusv](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@anusv](https://zatca1.discourse.group/u/anusv)\
**Post date:** [October 7, 2024, 12:50pm UTC](https://zatca1.discourse.group/t/issue-with-relative-paths-in-sdk-version-3-3-4/2574/14 "2024-10-07T12:50:52Z")

</div>

Dear @eCloud  
For signing of invoice and hash generation do we need this folder in project ?

---

<div class="post-metadata">

**Author:** ![eCloud](https://dub1.discourse-cdn.com/flex013/user_avatar/zatca1.discourse.group/ecloud/32/629_2.png) [@eCloud](https://zatca1.discourse.group/u/eCloud)\
**Post date:** [October 7, 2024, 1:29pm UTC](https://zatca1.discourse.group/t/issue-with-relative-paths-in-sdk-version-3-3-4/2574/15 "2024-10-07T13:29:34Z")

</div>

@anusv

Just clone the repository, build and run the code, it should work in your Windows PC.

Then you can see, how it works from the existing code sample.

---

<div class="post-metadata">

**Author:** ![Bassem.Badr](https://avatars.discourse-cdn.com/v4/letter/b/f07891/32.png) [@Bassem.Badr](https://zatca1.discourse.group/u/Bassem.Badr)\
**Post date:** [November 26, 2024, 10:02am UTC](https://zatca1.discourse.group/t/issue-with-relative-paths-in-sdk-version-3-3-4/2574/16 "2024-11-26T10:02:16Z")

</div>

Hello,  
i am having the same issue when i publish the solution on docker, any ideas how can i fix it or patch it up ?

- using ver 3.3.7 .net 8
- added the dlls to my code and calling them from code

---

<div class="post-metadata">

**Author:** ![ralfarhan](https://dub1.discourse-cdn.com/flex013/user_avatar/zatca1.discourse.group/ralfarhan/32/775_2.png) [@ralfarhan](https://zatca1.discourse.group/u/ralfarhan)\
**Post date:** [January 13, 2025, 10:36am UTC](https://zatca1.discourse.group/t/issue-with-relative-paths-in-sdk-version-3-3-4/2574/17 "2025-01-13T10:36:11Z")

</div>

I need further clarification regarding changing the data path. Unfortunately, I posted about this over 15 days ago, but none of my posts have been approved by the admins for publication. My post link is [Changing Data Path](https://zatca1.discourse.group/t/changing-data-path/4797). Could you please approve it or, at the very least, let me know the reason for the delay in approval?
