@Pramod Garikapati I believe you are running into an issue where the non-C# code isn't referencing the .net native nuget package. I've written instructions to get this scenario to work from a C++ app but hopefully similar/the same instructions apply to the PWA project
How to consume a C# WinRT component from C++/WinRT
“Unknown Runtime Error” when using Windows Runtime Component with Javascript UWP PWA
I'm trying to use a Windows Runtime Component to provide interoperability between my Javascript UWP PWA app and C# logic that I've written.
If I set the minimum version to Fall Creator's Update (build 16299, need to use .NET Standard 2.0 libraries),
https://devblogs.microsoft.com/dotnet/announcing-uwp-support-for-net-standard-2-0/,
I get the following error when trying to call a simple method: "JavaScript runtime error: Unknown runtime error"
If I run this code using Creator's Update (15063) as the minimum, then the code runs fine.
Can someone please let me know how to solve this issue.
Universal Windows Platform (UWP)
-
Richard Zhang-MSFT 6,936 Reputation points
2020-03-13T01:08:12.943+00:00 Hi, we have received reports of similar issues and will discuss them internally, and if there is new progress, I will post here.
-
Pramod Garikapati 1 Reputation point
2020-03-13T01:56:53.983+00:00 Hi Richard,
Thanks for the reply, please update us with the progress soon.
Thanks,
Pramod. -
Richard Zhang-MSFT 6,936 Reputation points
2020-03-13T03:24:06.14+00:00 Hi, If version 15063 works, it is currently recommended that you stay at the minimum version 15063 until a workable solution is available
-
Pramod Garikapati 1 Reputation point
2020-03-13T05:38:47.997+00:00 Hi Richard,
Version 15063 works, but the problem with that is we can't use a Net Standard 2.0 component from that as it's supported from 16299 only. Please check this https://devblogs.microsoft.com/dotnet/announcing-uwp-support-for-net-standard-2-0
Also we have a Net Standard 2.0 component which we are using in normal UWP-xaml which we have to reuse in this approach of UWP PWA.
Please help us solving this problem.
Thanks, Pramod.
-
Pramod Garikapati 1 Reputation point
2020-03-17T07:02:09.487+00:00 Hi Richard,
Is there any update, please post us.
Thanks,
Pramod. -
Richard Zhang-MSFT 6,936 Reputation points
2020-03-17T07:04:42.183+00:00 Sorry for the late reply. The engineer has noticed your problem and is currently debugging. If there is new information, I will post it here.
-
Pramod Garikapati 1 Reputation point
2020-03-27T11:45:46.813+00:00 Hi Richard,
we are completely blocked here, can you please help us in solving this at the earliest please.
-
Richard Zhang-MSFT 6,936 Reputation points
2020-04-01T08:50:32.877+00:00 Hi, I hope you are well. Our engineers are still following this case, and notice that the problem only occurs when the debugger is connected. If the debugger is not connected, everything is normal, do you encounter the same problem?
-
Pramod Garikapati 1 Reputation point
2020-04-01T10:24:09.567+00:00 Hi Richard,
Thanks for asking, i am doing good. Can you be more specific on "the problem only occurs when the debugger is connected", i am running from visual studio always in debug mode. Do you mean to test this in release mode (or) create the appx and run the app and verify the scenario?.
can you respond at the earliest please.
-
Richard Zhang-MSFT 6,936 Reputation points
2020-04-01T11:19:05.58+00:00 I think so, you can try publishing and installing the app to see if it works
-
Pramod Garikapati 1 Reputation point
2020-04-03T09:45:22.797+00:00 Hi Richard,
We couldn't publish our app because it's a POC, but we created .appx and installed and tested without any success(not throwing any error but not calling the method from .winmd)
I have uploaded a simple application, can you please download it from the below link and debug and let me know if i am doing anything wrong here please.
https://konyone-my.sharepoint.com/:u:/g/personal/pramod_garikapati_kony_com/Eftplgus-P1CngOQseVRQusBts8hQk66OqSyHDmwsdea9g?e=JNNVlMHighly appreciate your help in this regard.
-
Richard Zhang-MSFT 6,936 Reputation points
2020-04-03T09:50:20.327+00:00 Hello, thank you for your understanding. Due to recent covid-19 reasons, the testing work has been affected to a certain extent. If there are new developments, I will post here as soon as possible.
-
Pramod Garikapati 1 Reputation point
2020-04-03T09:53:13.47+00:00 Hi Richard,
Thanks for trying to help me here, we will be waiting for new updates from your side as we are completely stuck with this. -
Richard Zhang-MSFT 6,936 Reputation points
2020-04-03T10:19:12+00:00 I understand the difficulties you have encountered, but from the current point of view, it may be difficult to solve this problem from the code level. In addition to creating applications through UWP, you can also try other technical solutions during the period of waiting for test results.
-
Pramod Garikapati 1 Reputation point
2020-05-11T11:19:27.613+00:00 Hi Richard,
With the suggestion Alexander has given below, now i am able to reference .net native nuget package. While debugging we can see that the nuget referencing is not working properly in debug mode where as it is working in release mode.
We are encountering other issues with our app flow in release mode but unable to fix those because of the referencing problem in debug mode. can you throw your expertise on this.
Thanks,
Pramod. -
Pramod Garikapati 1 Reputation point
2020-06-16T08:27:31.46+00:00 Hi Richard,
We followed the suggestion shared by Alexander and our approach is working fine in release mode whereas we are still facing issues with debug mode.
We are stuck with another problem where we are unable to use "JsonConvert.DeserializeObject" from Newtonsoft. When we tried to DeserializeObject we are getting error "Dynamic code generation is not supported on this platform." where as the same is working with regular windows universal application.
I have uploaded a sample application, can you please download it from the below link, debug and let me know if i am doing anything wrong here please.
https://1drv.ms/u/s!AiRUJ-H3vDEwgYgaz-Ad_q8QiBmpYw?e=7BIKVcThanks,
Pramod.
Sign in to comment
1 answer
Sort by: Most helpful
-
AlexanderSklar 11 Reputation points
2020-04-22T01:05:33.697+00:00 -
Pramod Garikapati 1 Reputation point
2020-05-11T11:18:48.73+00:00 Hi Alexander,
With your suggestion now i am able to reference .net native nuget package. While debugging we can see that the nuget referencing is not working properly in debug mode where as it is working in release mode.
We are encountering other issues with our app flow in release mode but unable to fix those because of the referencing problem in debug mode. can you throw your expertise on this.
Thanks,
Pramod. -
Pramod Garikapati 1 Reputation point
2020-06-16T08:25:59.907+00:00 Hi Alexander,
We followed your suggestion and our approach is working fine in release mode whereas we are still facing issues with debug mode, once again we thank you for the suggestion which you have provided.
We are stuck with another problem where we are unable to use "JsonConvert.DeserializeObject" from Newtonsoft. When we tried to DeserializeObject we are getting error "Dynamic code generation is not supported on this platform." where as the same is working with regular windows universal application.
I have uploaded a sample application, can you please download it from the below link, debug and let me know if i am doing anything wrong here please.
https://1drv.ms/u/s!AiRUJ-H3vDEwgYgaz-Ad_q8QiBmpYw?e=7BIKVcThanks,
Pramod. -
Pramod Garikapati 1 Reputation point
2020-08-04T07:42:57.95+00:00 Hi Alexander,
Can you throw some light on the following error, this is in debug mode. i already installed nuget Microsoft.Net.Native.Compiler version 2.2.3 which is latest.
7>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(1248,5): error MSB3816: Loading assembly "C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\runtime.win10-x86.microsoft.netcore.universalwindowsplatform\6.2.8\runtimes\win10-x86\lib\uap10.0.15138\System.Diagnostics.DiagnosticSource.dll" failed. System.IO.FileNotFoundException: Could not load file or assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.
Sign in to comment -