aws / aws-sdk-net

The official AWS SDK for .NET. For more information on the AWS SDK for .NET, see our web site:
http://aws.amazon.com/sdkfornet/
Apache License 2.0
2.07k stars 862 forks source link

AWSSDK.CORE dll within Unity packages has a conflict with the MSBuildForUnity #1607

Closed jeff0fisher closed 3 years ago

jeff0fisher commented 4 years ago

When importing both the AWSSDK Unity packages and the MixedRealityTookKit (MRTK) unity packages, there is an overlap in functions that are preventing Unity from building.

Expected Behavior

I expect the packages to not overlap functions

Current Behavior

Library\PackageCache\com.microsoft.msbuildforunity@0.9.1-20200131.14\Editor\ProjectGenerator\Scripts\Exporters\TextSolutionFileParser.cs(344,23): error CS0433: The type 'InvalidDataException' exists in both 'AWSSDK.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=null' and 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Library\PackageCache\com.microsoft.msbuildforunity@0.9.1-20200131.14\Editor\ProjectGenerator\Scripts\AssetScriptReferenceRetargeter.cs(150,31): error CS0433: The type 'InvalidDataException' exists in both 'AWSSDK.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=null' and 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Library\PackageCache\com.microsoft.msbuildforunity@0.9.1-20200131.14\Editor\ProjectGenerator\Scripts\AssetScriptReferenceRetargeter.cs(237,43): error CS0433: The type 'InvalidDataException' exists in both 'AWSSDK.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=null' and 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Library\PackageCache\com.microsoft.msbuildforunity@0.9.1-20200131.14\Editor\ProjectGenerator\Scripts\Templates\FileTemplate.cs(34,27): error CS0433: The type 'InvalidDataException' exists in both 'AWSSDK.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=null' and 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

Possible Solution

Steps to Reproduce (for bugs)

Import any AWSSDK Unity package, and the MRTK foundation package.

Context

Your Environment

.NET Core Info

nanop commented 4 years ago

MixedRealityTookKit

I get the same issue with Addressables, if I remove addressables then AWS sdk installs properly

Library/PackageCache/com.unity.scriptablebuildpipeline@1.7.2/Editor/CacheServer/Client.cs(464,35): error CS0433: The type 'InvalidDataException' exists in both 'AWSSDK.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=null' and 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

nanop commented 4 years ago

I found the solution for these issues... They apparently have deprecated this api.. use the below instead and the documentation is horrible, heres an alternative they are asking us to use https://aws.amazon.com/blogs/developer/referencing-the-aws-sdk-for-net-standard-2-0-from-unity-xamarin-or-uwp/

jeff0fisher commented 4 years ago

@nanop well that is interesting, I'll have to give that a try. The only major issue I guess is all the code samples I've found are the ones based off of the api you said is deprecated. Going to make this a little more tricky,

nanop commented 4 years ago

@jeff0fisher yeah for sure it sucks.. however the new api isnt that different I felt... feel free to ask me any questions related and Im happy help ;)

jeff0fisher commented 4 years ago

@nanop Well I guess to start, the unity package samples always called for a prefab to be initialized, that was withing the AWSSKD.CORE dll, but i don't see it now in .net standard 2.0 .core dlls. Not sure what was in that prefab, but I'm guessing I'll have replace it with something.

nanop commented 4 years ago

@jeff0fisher you dont need UnityInitialize, what the hell was it doing anyways.. like u said either attach it a prefab or main camera doesnt really matter.

PremiumArts commented 4 years ago

@NGL321 We have the same problem about MixedRealityTookKit(MRTK).

We are developing a project with Vuforia Engine and MixedRealityTookKit(MRTK). When importing both the AWSSDK Unity packages and the MRTK unity packages, there is an error message that are preventing Unity from console.

error CS0433: The type 'InvalidDataException' exists in both 'AWSSDK.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=null' and 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Develop environment Visual Studio version: 2020. Unity version: 2019.3.3f1. Vuforia version: 9.3.3. MRTK version: 2.4.

We think the 'InvalidDataException' problem because AWSSDK.CORE dll within Unity packages has a conflict with the MSBuildForUnity.

Is there any solution for these issues?

Thank you.

nanop commented 4 years ago

@NGL321 We have the same problem about MixedRealityTookKit(MRTK).

We are developing a project with Vuforia Engine and MixedRealityTookKit(MRTK). When importing both the AWSSDK Unity packages and the MRTK unity packages, there is an error message that are preventing Unity from console.

error CS0433: The type 'InvalidDataException' exists in both 'AWSSDK.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=null' and 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Develop environment Visual Studio version: 2020. Unity version: 2019.3.3f1. Vuforia version: 9.3.3. MRTK version: 2.4.

We think the 'InvalidDataException' problem because AWSSDK.CORE dll within Unity packages has a conflict with the MSBuildForUnity.

Is there any solution for these issues?

Thank you.

They don’t support it, did u read my comment, check the blog, does this not work for you ? https://aws.amazon.com/blogs/developer/referencing-the-aws-sdk-for-net-standard-2-0-from-unity-xamarin-or-uwp/

PremiumArts commented 4 years ago

@NGL321 We have the same problem about MixedRealityTookKit(MRTK). We are developing a project with Vuforia Engine and MixedRealityTookKit(MRTK). When importing both the AWSSDK Unity packages and the MRTK unity packages, there is an error message that are preventing Unity from console. error CS0433: The type 'InvalidDataException' exists in both 'AWSSDK.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=null' and 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Develop environment Visual Studio version: 2020. Unity version: 2019.3.3f1. Vuforia version: 9.3.3. MRTK version: 2.4. We think the 'InvalidDataException' problem because AWSSDK.CORE dll within Unity packages has a conflict with the MSBuildForUnity. Is there any solution for these issues? Thank you.

They don’t support it, did u read my comment, check the blog, does this not work for you ? https://aws.amazon.com/blogs/developer/referencing-the-aws-sdk-for-net-standard-2-0-from-unity-xamarin-or-uwp/

Thanks for your replay. Yes, We have already tried that solution, but it doesn't work on our develop environment with Unity 2019.3.3f1. As we traced other issue, we found that might be related to the difference of Unity 2018 and 2019. We got some hints from other discussion in the issue page and we are stilling trying other potential solutions for us.

nanop commented 4 years ago

@NGL321 We have the same problem about MixedRealityTookKit(MRTK). We are developing a project with Vuforia Engine and MixedRealityTookKit(MRTK). When importing both the AWSSDK Unity packages and the MRTK unity packages, there is an error message that are preventing Unity from console. error CS0433: The type 'InvalidDataException' exists in both 'AWSSDK.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=null' and 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Develop environment Visual Studio version: 2020. Unity version: 2019.3.3f1. Vuforia version: 9.3.3. MRTK version: 2.4. We think the 'InvalidDataException' problem because AWSSDK.CORE dll within Unity packages has a conflict with the MSBuildForUnity. Is there any solution for these issues? Thank you.

They don’t support it, did u read my comment, check the blog, does this not work for you ? https://aws.amazon.com/blogs/developer/referencing-the-aws-sdk-for-net-standard-2-0-from-unity-xamarin-or-uwp/

Thanks for your replay. Yes, We have already tried that solution, but it doesn't work on our develop environment with Unity 2019.3.3f1. As we traced other issue, we found that might be related to the difference of Unity 2018 and 2019. We got some hints from other discussion in the issue page and we are stilling trying other potential solutions for us.

Hmm! That’s odd, we have unity 2019.3 and .4 it works on both. Good luck. Happy to help

ashishdhingra commented 3 years ago

Hi @jeff0fisher,

If this is still an issue, please try using the .NET Standard 2.0 version of the AWS SDK for .NET (version 3.5).

Thanks, Ashish

github-actions[bot] commented 3 years ago

This issue has not recieved a response in 2 weeks. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.