問題
使用Visual Studio 2012 建置專案時,出現了如下的錯誤
Warning 6 There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "msshrtmi, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=AMD64", "AMD64". 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.
原因
我在這個專案使用了 Windows Azure的雲端 assembly msshrtmi,並且指定了 x64的版本。但在建置的設定上,卻指定為 Any CPU。雖然編譯會過,但一定要部署到 x64 的作業系統才能正常運作。
在 .NET 4.5 後 ,編譯會多出這樣的警告。
解決
一直出現這樣的警告實在很惱人。把該專案的 Platform target 設成 x64 就解決了這個問題
沒有留言:
張貼留言