![](/img/trans.png)
[英]Adding DLL into 'Class Library Project': Mismatch between the processor architecture warning
[英].NET reference not available in my project (Class Library). Getting compiler error “mismatch between processor architecture”
我有一個需要使用.NET
引用才能工作的類庫,因為它利用了許多System
API,但無法從“ Add References
對話框中添加該引用。 在.NET
引用不是下提供Assemblies
的Reference Manager
。
這是我的項目的樣子,在構建該項目時出現以下錯誤:
There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:\\WINDOWS\\Microsoft.NET\\Framework\\v4.0.30319\\\\mscorlib.dll", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.
以下是我的參考管理器的屏幕截圖
我希望將.NET
參考附加到下圖。任何想法如何解決此問題? 提前致謝 :)
找到了這個問題的答案。
要解決流程體系結構不匹配的問題,我遵循以下步驟:
首先,我在項目中卸載了nuget
軟件包。
然后,我打開了項目的屬性。 左鍵單擊項目,然后打開“ Properties
。
單擊左側面板中的Library
,然后在“ Targets
下單擊“ Change
。 如果.NET Framework
已選中,則取消選中它並單擊“ Ok
保存。
然后重新安裝nuget
軟件包並重新構建。 它像魅力一樣運作。 似乎Visual Studio 2017會自動添加.NET
參考。 我相信它是VS 2017中的錯誤
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.