# ECW Layer Failure

**URL:** <https://community.thinkgeo.com/t/ecw-layer-failure/9902>\
**Category:** ThinkGeo UI for Desktop\
**Created:** [September 1, 2020, 6:00pm UTC](https://community.thinkgeo.com/t/ecw-layer-failure/9902 "2020-09-01T18:00:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Damian\_Hite](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/d2c977/32.png) [@Damian\_Hite](https://community.thinkgeo.com/u/Damian_Hite)\
**Post date:** [September 1, 2020, 6:00pm UTC](https://community.thinkgeo.com/t/ecw-layer-failure/9902/1 "2020-09-01T18:00:27Z")

</div>

Hi,

I am having similar issue as mentioned in the following post.

[https://community.thinkgeo.com/t/problem-with-ecw-raster-layer-in-version-10](https://community.thinkgeo.com/t/problem-with-ecw-raster-layer-in-version-10)

However, the example projects are corrupt and will not extract when I download them.

Also, here is the exact error I get when I try and open the layer, so not sure this is same issue as the other user.

The type initializer for ‘ehQ=.y0o=’ threw an exception.

Like the other user mentioned, the file loads in v9. I am using 10 latest stable.

Regards,  
Damian

---

<div class="post-metadata">

**Author:** ![Frank4](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/frank4/32/25224_2.png) [@Frank4](https://community.thinkgeo.com/u/Frank4)\
**Post date:** [September 1, 2020, 9:08pm UTC](https://community.thinkgeo.com/t/ecw-layer-failure/9902/2 "2020-09-01T21:08:18Z")

</div>

Damian,  
Could you send us the ECW file. We could look into more detail.

Thanks

Frank

---

<div class="post-metadata">

**Author:** ![Damian\_Hite](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/d2c977/32.png) [@Damian\_Hite](https://community.thinkgeo.com/u/Damian_Hite)\
**Post date:** [September 1, 2020, 10:09pm UTC](https://community.thinkgeo.com/t/ecw-layer-failure/9902/3 "2020-09-01T22:09:23Z")

</div>

Hi Frank,

It’s over 100Mb and it’s confidential. Can you advice a secure upload method?

Also, none of the ECW files I have will open in v10. Same error each time, so would imagine any one would do.

Thanks,  
Damian

---

<div class="post-metadata">

**Author:** ![Frank4](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/frank4/32/25224_2.png) [@Frank4](https://community.thinkgeo.com/u/Frank4)\
**Post date:** [September 2, 2020, 4:36pm UTC](https://community.thinkgeo.com/t/ecw-layer-failure/9902/4 "2020-09-02T16:36:37Z")

</div>

Thanks Damian,  
I attached you a demo project to load the ecw file. Could you change the path see if your file could be loaded. [HelloWorld.zip](https://community.thinkgeo.com/uploads/short-url/1NsjCNODXCSZvEHL0bIINExC30a.zip) (179.5 KB)

 ![image](https://community.thinkgeo.com/uploads/default/original/3X/c/b/cbc4dd85ab66721cbfed8649ab5e2b5614a9950a.jpeg)

If still not work for you. You could send a small your ecw file to [support@thinkgeo.com](mailto:support@thinkgeo.com) We could look into more detail.

Thanks

Frank

---

<div class="post-metadata">

**Author:** ![Damian\_Hite](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/d2c977/32.png) [@Damian\_Hite](https://community.thinkgeo.com/u/Damian_Hite)\
**Post date:** [September 2, 2020, 4:59pm UTC](https://community.thinkgeo.com/t/ecw-layer-failure/9902/5 "2020-09-02T16:59:08Z")

</div>

Hi Frank,

I now see that the error occurs when reprojecting the layer.

Put this line in your sample and change map unit to meter.

ecwRasterLayer.ImageSource.Projection = new Proj4Projection(4326, 3857);

Regards,  
Damian

---

<div class="post-metadata">

**Author:** ![Damian\_Hite](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/d2c977/32.png) [@Damian\_Hite](https://community.thinkgeo.com/u/Damian_Hite)\
**Post date:** [September 2, 2020, 5:04pm UTC](https://community.thinkgeo.com/t/ecw-layer-failure/9902/6 "2020-09-02T17:04:59Z")

</div>

Hi Frank,

Sorry, that wasn’t it. I was just missing unmanagedproj4 dependency.

So far, the layer is working with my image in this test project and reprojecting. I will see if I can reproduce the issue from my larger project. Maybe more nuget trouble…

Regards,  
Damian

---

<div class="post-metadata">

**Author:** ![Damian\_Hite](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/d2c977/32.png) [@Damian\_Hite](https://community.thinkgeo.com/u/Damian_Hite)\
**Post date:** [September 2, 2020, 5:42pm UTC](https://community.thinkgeo.com/t/ecw-layer-failure/9902/7 "2020-09-02T17:42:16Z")

</div>

Hi Frank,

Yes, it’s NuGet again. The HexagonGeospatialEcw directory was not copied to the Windows-X64 and Windows-X86 directories of my build.

Not only that, but the build folder for this library was also missing the file ThinkGeo.MapSuite.Wrappers.EcwX64.dll

Manually copying the files worked and the error is now gone, but I really could use some help trying to understand why these files aren’t automatically going into the build. Seems like a script didn’t run to get the dll file.

Something else I notice is that my build directory does not have the .targets files for

MapSuiteDependency-HexagonGeospatialEcw.targets  
MapSuiteDependency-UnmanagedProj4Projection.targets

Shouldn’t this be automatic as well?

Regards,  
Damian

---

<div class="post-metadata">

**Author:** ![Frank4](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/frank4/32/25224_2.png) [@Frank4](https://community.thinkgeo.com/u/Frank4)\
**Post date:** [September 2, 2020, 9:24pm UTC](https://community.thinkgeo.com/t/ecw-layer-failure/9902/8 "2020-09-02T21:24:24Z")

</div>

Thanks Damian,  
Yes. This is strange. This happen when the .csproj(visual studio project file) mess up for some reason. If this happen I will create a brand new project to verify the mapsuite function and compare the bin folder with the original project.

Thanks

Frank
