-
Notifications
You must be signed in to change notification settings - Fork 577
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
assembly 'System.Runtime' is needed to compile #416
Comments
I had the same problem on windows 10 update 1607.
|
Can you post a complete example about how are you using that code? I am still having that problem. Thanks. |
@juanjose53 written above class usage:
Maybe you have some other problem? Can you provide some diagnostic info about your problem? Usually razor outputs debug information in %temp% directory. For example in my case there was |
Hi Irina, I attach the output of your example running from my app. Thanks in advance for your help. |
@juanjose53 I think you have the same issue. I see in your output some suspicious libs:
I think custom |
@ierof Do you want to contribute this to the docs. Or should we add this to |
@matthid up to you. If you think it necessary, you can add in to the docs :) |
Side note to ierof's Sept 30 comment above: The where clause is in the example is incorrect. The where clause should be: The example still returns "C:\WINDOWS\system32\WinMetadata\Windows.UI.winmd" and "C:\WINDOWS\system32\WinMetadata\Windows.Foundation.winmd" |
@dalekawamura thanks! You're right. My example is corrent now. |
Another workaround is to add System.Runtime to the assembly list. private class SystemRuntimeResolver : IReferenceResolver
{
private static readonly IReferenceResolver _resolver = new UseCurrentAssembliesReferenceResolver();
private static readonly Assembly _systemRuntime = Assembly.Load("System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
public IEnumerable<CompilerReference> GetReferences(TypeContext context, IEnumerable<CompilerReference> includeAssemblies = null)
{
IEnumerable<CompilerReference> assemblies;
var newReference = new[] { CompilerReference.From(_systemRuntime), };
if (includeAssemblies == null)
{
assemblies = newReference;
}
else
{
assemblies = includeAssemblies.Concat(newReference);
}
return _resolver.GetReferences(context, assemblies);
}
} |
Hi Team,
I am getting the following error when I try to cumpile my template. (I am using .net 4.6.2)
Thanks for your help
Temporary files of the compilation can be found in (please delete the folder)
The text was updated successfully, but these errors were encountered: