第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

無法從程序集的mcorlib加載類型‘System.Runtime.CompilerServices

無法從程序集的mcorlib加載類型‘System.Runtime.CompilerServices

德瑪西亞99 2019-08-03 16:03:13
無法從程序集的mcorlib加載類型‘System.Runtime.CompilerServices.ExtensionAttribute’當(dāng)我第一次啟動我的網(wǎng)站時,我收到了這個錯誤Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'我做錯什么了?我正在使用.NET 4,并從VisualStudio啟動該站點。我最近唯一改變的是在我的項目中添加簡單的注入器(通過Nuget)。這是堆棧跟蹤[TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.]   System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type) +0   System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) +180   System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) +192   System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg) +115
查看完整描述

3 回答

?
嚕嚕噠

TA貢獻1784條經(jīng)驗 獲得超7個贊

我遇到了這個問題,除了無法加載的類型是System.Reflection.AssemblyMetadataAttribute。Web應(yīng)用程序是在安裝了.NET 4.5(在那里運行良好)的計算機上構(gòu)建的,目標(biāo)框架是4.0,但在安裝了4.0的Web服務(wù)器上運行時出現(xiàn)了錯誤。然后我在一個安裝了4.5的Web服務(wù)器上試了一下,沒有出現(xiàn)錯誤。因此,正如其他人所說,這一切都是由于微軟發(fā)布4.5版本的方式異常,這基本上是對4.0版的升級和覆蓋。反射程序集引用4.0中不存在的類型(AssemblyMetadataAttribute),因此如果沒有新的System.Reflection.dll,它將失敗。

您可以在目標(biāo)Web服務(wù)器上安裝.NET 4.5,也可以在沒有安裝4.5的機器上構(gòu)建應(yīng)用程序。遠(yuǎn)非理想的解決方案。

 


查看完整回答
反對 回復(fù) 2019-08-05
?
慕少森

TA貢獻2019條經(jīng)驗 獲得超9個贊

我在一個站點(KenticoCMS)上遇到了同樣的問題,從4.5開始開發(fā),發(fā)現(xiàn)生產(chǎn)服務(wù)器只支持4.0,我試著返回到目標(biāo)框架4.0。編譯這個線程中的其他帖子(特別是將目標(biāo)框架更改為.NET 4和.NET 4.5)。我搜索了我的解決方案,發(fā)現(xiàn)有幾個NuGet包仍然在使用帶有Target tFramework=“net 45”的庫。

packages.config (before):<?xml version="1.0" encoding="utf-8"?><packages>
  <package id="AutoMapper" version="3.1.0" targetFramework="net45" />
  <package id="EntityFramework" version="5.0.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi.Client" version="5.0.0" targetFramework="net45" />
  <package id="Newtonsoft.Json" version="4.5.11" targetFramework="net45" /></packages>

我將項目目標(biāo)框架改為4.5,刪除了所有NuGet庫,返回到4.0并重新添加了庫(必須使用一些不依賴于4.5的早期版本)。

packages.config (after):<?xml version="1.0" encoding="utf-8"?><packages>
  <package id="AutoMapper" version="3.1.1" targetFramework="net40" />
  <package id="EntityFramework" version="6.0.2" targetFramework="net40" />
  <package id="Microsoft.AspNet.WebApi.Client" version="4.0.30506.0" targetFramework="net40" />
  <package id="Microsoft.Net.Http" version="2.0.20710.0" targetFramework="net40" />
  <package id="Newtonsoft.Json" version="4.5.11" targetFramework="net40" /></packages>




查看完整回答
反對 回復(fù) 2019-08-05
  • 3 回答
  • 0 關(guān)注
  • 612 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號