Why "System.Environment.GetFolderPath(SpecialFolder)" method is not found during run time?
Hi,
I have a Progressive Web App(Universal Windows) which uses a Windows Runtime Component(Universal Windows). This Windows Runtime Component(Universal Windows) uses a .Net Standard library(.dll).
Properties of Progressive Web App(Universal Windows):
After running Progressive Web App(Universal Windows), a button appears and when we click this button below code snippet executes in which a method from Windows Runtime Component(Universal Windows) is called.
function onClickbtn()
{
var strPath=WinMDComponent.WinMDComp.getPath();
}
In Windows Runtime Component(Universal Windows) project i have the below code which calls a method from the .Net Standard library:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WinMDComponent
{
public sealed class WinMDComp
{
public static string getPath()
{
return NetStandard2Component.NetStand2Comp.getDataPath();
}
}
}
in .Net Standard project i have the below code:
using System;
namespace NetStandard2Component
{
public class NetStand2Comp
{
public static string getDataPath()
{
return Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
}
}
}
Problem Description:
1.If i keep the minimum version of Windows Runtime Component(Universal Windows) project as 10240 (Target Version is always 16299) , i had to add "netstandard.dll" as a reference in Windows Runtime Component(Universal Windows) project and after running Progressive Web App(Universal Windows) project i got below error
2.If i keep the minimum version of Windows Runtime Component(Universal Windows) project as 16299 (Target Version is always 16299) , i don't need to add "netstandard.dll" as a reference in Windows Runtime Component(Universal Windows) project and if run Progressive Web App(Universal Windows) project i got below error:
Can anyone help me to solve this problem?