Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to compile with .Net Native Toolchain once Microsoft.TSS is added #8

Closed
mms- opened this issue Mar 3, 2017 · 6 comments
Closed

Comments

@mms-
Copy link

mms- commented Mar 3, 2017

This is on a UWP app. Disabling .Net Native Toolchain works, Debug build works, both compile and run. This is on VS 2017 RC.

Here is the error, any way around this:

2> Generating code...
2> Interop code generated.
2> Generating serialization code
2> Compiling interop code
2>C:\Users\marek.nuget\packages\microsoft.net.native.compiler\1.6.0\tools\Microsoft.NetNative.targets(691,5): error : System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
2>C:\Users\marek.nuget\packages\microsoft.net.native.compiler\1.6.0\tools\Microsoft.NetNative.targets(691,5): error : at System.Collections.Generic.Dictionary2.get_Item(TKey key) 2>C:\Users\marek\.nuget\packages\microsoft.net.native.compiler\1.6.0\tools\Microsoft.NetNative.targets(691,5): error : at SerializationAssemblyGenerator.Program.AddKnownContractsLists(McgCodeTypeDeclaration container, ContractTables tables) 2>C:\Users\marek\.nuget\packages\microsoft.net.native.compiler\1.6.0\tools\Microsoft.NetNative.targets(691,5): error : at SerializationAssemblyGenerator.Program.GenerateDataContractSerializerHelperCode(IEnumerable1 contracts, IEnumerable1 jsonContracts, IEnumerable1 wcfSerializers)
2>C:\Users\marek.nuget\packages\microsoft.net.native.compiler\1.6.0\tools\Microsoft.NetNative.targets(691,5): error : at SerializationAssemblyGenerator.Program.GenerateDataContractSerializerHelper(IEnumerable1 contracts, IEnumerable1 jsonContracts, GeneratorSettings settings, String intermediateAssembly, IEnumerable`1 wcfSerializers)
2>C:\Users\marek.nuget\packages\microsoft.net.native.compiler\1.6.0\tools\Microsoft.NetNative.targets(691,5): error : at SerializationAssemblyGenerator.Program.Main(String[] args)
2> Generating System.Reflection.DispatchProxy proxy code.
2>C:\Users\marek.nuget\packages\microsoft.net.native.compiler\1.6.0\tools\Microsoft.NetNative.targets(691,5): error : ILT0032: Failed to compile serialization code. See the build log for error details.

@mms-
Copy link
Author

mms- commented Mar 3, 2017

Adding <Namespace Name="Tpm2Lib" Serialize="Excluded" Browse="Excluded" Activate="Excluded" Dynamic="Excluded" XmlSerializer="Excluded" /> to Default.rd.xml seems to fix it. I assume none of these are needed for TSS.NET to function.

Please add this to the Nuget nuspec, the file should be output by the Nuget itself as done here for example : https://github.com/Caliburn-Micro/Caliburn.Micro/blob/287203eb5be2242946bfd354eb6d6638d0389af5/nuget/Caliburn.Micro.nuspec

@ArquintL
Copy link

Are there any news? I'm unable to use the Nuget package on Windows IoT, however including the source code works in Debug mode. In Release mode, I get the following warning while compiling and the program crashes shortly after deploying it with a similar exception.
@mms- adding your suggested xml tag didn't solve my problem. Do you have another fix or at least an idea?

3>  C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /unsafe+ /pdb:C:\KvsUnitTests\ARM\Release\ilc\intermediate\ade45118-daed-4e4d-bf75-d50dc269d2b7.pdb /nostdlib+ /reference:"C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\ARM\ilc\lib\Private\System.Private.CoreLib.dll" /debug:full /out:C:\KvsUnitTests\ARM\Release\ilc\intermediate\ade45118-daed-4e4d-bf75-d50dc269d2b7.exe /target:winexe C:\KvsUnitTests\ARM\Release\ilc\intermediate\fake.cs
3>CSC : warning : Invalid search path 'lib\um\arm' specified in 'LIB environment variable' -- 'The system cannot find the path specified. '
3>  Processing application code
3>  Computing application closure and generating interop code
3>C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\ARM\ilc\IlcInternals.targets(936,5): warning : ILTransform_0000:       MCG : warning MCG0006: Unresolved P/Invoke method 'Tbsi_Context_Create!tbs.dll' in assembly 'TSS.UWP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' because it is not available in UWP applications. Please either use an another API , or use [DllImport(ExactSpelling=true) to indicate that you understand the implications of using non-UWP application APIs.
3>C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\ARM\ilc\IlcInternals.targets(936,5): warning : ILTransform_0000:       MCG : warning MCG0006: Unresolved P/Invoke method 'Tbsip_Context_Close!tbs.dll' in assembly 'TSS.UWP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' because it is not available in UWP applications. Please either use an another API , or use [DllImport(ExactSpelling=true) to indicate that you understand the implications of using non-UWP application APIs.
3>C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\ARM\ilc\IlcInternals.targets(936,5): warning : ILTransform_0000:       MCG : warning MCG0006: Unresolved P/Invoke method 'Tbsip_Submit_Command!tbs.dll' in assembly 'TSS.UWP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' because it is not available in UWP applications. Please either use an another API , or use [DllImport(ExactSpelling=true) to indicate that you understand the implications of using non-UWP application APIs.

@MelbourneDeveloper
Copy link

I have this same issue. We are stopped dead in our tracks from deploying to the store because of this issue.

@CIPop
Copy link
Member

CIPop commented Oct 7, 2017

@amarochk is this still an issue? If so it'll block us from releasing on UWP as well.

/cc @tameraw @jasmineymlo

@amarochk
Copy link
Contributor

amarochk commented Oct 7, 2017 via email

@ArquintL
Copy link

After updating Visual Studio to 15.7.3 (Visual Studio Community 2017) and updating the Microsoft.NETCore.UniversalWindowsPlatform NuGet package to version 6.1.5, I was able to compile with Release configuration (using Microsoft.TSS 2.0.1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants