gpt4 book ai didi

c# - Microsoft.Build.Tasks.v12.0.dll 上的 UniversalApp 错误 "GenerateResource task failed unexpectedly"

转载 作者:行者123 更新时间:2023-11-30 13:06:50 25 4
gpt4 key购买 nike

我有一个带有一些自定义 PCL 库的 Visual Studio 2013 Update 3 解决方案,然后是一个包含 Windows 8.1、WindowsPhone 8.1 和共享位的 UniversalApp 项目。我正在尝试编译 WindowsPhone 项目。共享项目包含一些模型、 View 模型、实用程序类、图像和一些样式。

我不确定发生了什么变化,因为它之前是有效的,但现在我无法摆脱这个错误:

Error   8   The "GenerateResource" task failed unexpectedly.
System.IO.FileLoadException: Could not load file or assembly 'file:///C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.Build.Tasks.v12.0\v4.0_12.0.0.0__b03f5f7f11d50a3a\Microsoft.Build.Tasks.v12.0.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
File name: 'file:///C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.Build.Tasks.v12.0\v4.0_12.0.0.0__b03f5f7f11d50a3a\Microsoft.Build.Tasks.v12.0.dll' ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence securityEvidence)
at System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)
at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)
at System.AppDomain.CreateInstanceFromAndUnwrap(String assemblyName, String typeName)
at System.AppDomain.CreateInstanceFromAndUnwrap(String assemblyName, String typeName)
at Microsoft.Build.Tasks.GenerateResource.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()

我看过类似问题的帖子,但没有一个完全相同或修复有效。我尝试过的事情:

  • 已删除 .suo 文件
  • 已添加 <GenerateResourceNeverLockTypeAssemblies>true</GenerateResourceNeverLockTypeAssemblies>到项目文件
  • 已添加 <loadFromRemoteSources enabled="true" />到 devenv.exe.config 文件
  • 删除了 UniversalApp 项目并从头开始重新创建(虽然复制了一些文件)

最佳答案

我也有类似设置的相同问题(抱歉,无法评论 - 积分不够):Win10 + VS2015

我已将范围缩小到尝试将 MvvmCross 合并到我的 Win Phone 8.1 项目中。我正在使用 nuget 引入 3.2.1 mvvmcross 库。我已经检查了这些 dll,但它们都没有取消阻止按钮(好像它已经被取消阻止了)。

如果我删除 dll 引用,那么一切都会再次正常工作。

此外,以管理员身份运行也无济于事。我明天将我的项目拉到我的 Win8.1 盒子里,看看是否存在问题。

关于c# - Microsoft.Build.Tasks.v12.0.dll 上的 UniversalApp 错误 "GenerateResource task failed unexpectedly",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26771669/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com