How to solve warning “Referenced assembly targets a different processor than the application”

前端 未结 5 483
臣服心动
臣服心动 2021-01-03 19:06

I have been able to build my windows form application that access databases in SQL Server. All parts of the application are able to access the server apart from the part whe

相关标签:
5条回答
  • 2021-01-03 19:46

    it's been a year since you've asked this question.. but i just want to give the solution for this question...

    if you using VS2010, go to your Project Properties, go to Compile, Advanced Compile Option, then set your target CPU to x86 or x64... cannot be both... choose one...

    hope this solved.. :)

    0 讨论(0)
  • 2021-01-03 20:05

    Using Visual Studio 2010 I had to go to Project Properties -> Build Tab: Change "Platform target" from "Any CPU" to "x86"

    This cleared up the warning message for me.

    keywords: Referenced assembly targets a different processor than the application

    0 讨论(0)
  • 2021-01-03 20:06

    This is a bug with Visual Studio, it seems. Here's a more elaborate thread that explains some steps you can take to fix this.

    0 讨论(0)
  • 2021-01-03 20:10

    This error can also occur after a Windows 10 update if certain DLLs that you're using have been deregistered somehow. This is now the third time this has happened - and it causes normally fine CPU settings to appear broken.

    For me this keeps happening with Microsoft.mshtml - every major Windows 10 update!! - including the April 2018.

    Quick steps:

    • Open developer command prompt for visual studio (as administrator)
    • Run gacutil /l | find "Microsoft.mshtml"
    • Go to the folder C:\Windows\assembly\GAC\Microsoft.mshtml
    • Run dir and change to the directory
    • Run regasm Microsoft.mshtml.dll
    • Try to compile again

    http://techninotes.blogspot.com/2016/08/fixing-cannot-find-wrapper-assembly-for.html

    0 讨论(0)
  • 2021-01-03 20:12

    Using Visual Studio 2010 I went to Main Menu --> Build --> Configuration Manager...

    From there it's pretty obvious. Theres a big table. Each of your projects is a row. Look at the "platform" column. Change those entires to match each other.

    0 讨论(0)
提交回复
热议问题