Skip to content

Visual Studio 2013 Update 3 does not allow CefSharp to load #576

Closed

Description

@brfenske

I have Visual Studio 2013 Update 3 and have created a new WinForms project. I added CefSharp via NuGet. When I go to add the browser control to the form it complains that I'm using platform "AnyCPU".

If I go to the Build tab in Properties I see the "Platform" dropdown at the top which has only one choice: Active (AnyCPU)

I can change "Platform Target" farther down the page to x86. It appears that CefSharp cares about the Platform dropdown because it still gives the error "CefSharp.Common does not work correctly on 'AnyCPU' platform. You need to specify platform (x86 / x64)". I don't seem to be able to change the Platform drowdown at the top to anything else.

My packages.config has these lines:
package id="cef.redist" version="3.1750.1738" targetFramework="net45"
package id="CefSharp.Common" version="33.0.2" targetFramework="net45"
package id="CefSharp.WinForms" version="33.0.2" targetFramework="net45"

How have people been able to get around this?

Activity

  1. AJDev77 commented on Nov 5, 2014

    @AJDev77

    Same. Now I can't even access my project. Once I added CefSharp Visual Studio says "There is no editor available for "Project/Directory/file.vb". Make sure the application for the file type (.vb) is installed." It will not let me access any of my project files.

  2. amaitland commented on Nov 6, 2014

    @amaitland
    Member

    @brfenske CefSharp doesn't support AnyCPU as it's complied specifically for x64 and x86, so you need to pick one or the other.

    • Right click your solution, select Configuration Manager
    • From the Action Solution platform dropdown select New
    • Select either x86 or x64 based on your requirements
    • Press Ok
    • Press Close and you should now be targeting either x86 or x64

    This isn't a problem with VS2013. Nor is it technically a problem with CefSharp, the nuget package just forces you to choose a platform target, otherwise if you'd stayed with AnyCPU, you would have compiled, and run your app and CefSharp would have silently failed.

    Now I can't even access my project. Once I added CefSharp Visual Studio says "There is no editor available for "Project/Directory/file.vb". Make sure the application for the file type (.vb) is installed." It will not let me access any of my project files.

    @AJDev77 Try the steps above. It's possible yours might be a different problem. If that's the case, please open a unique issue.

  3. jornh commented on Nov 6, 2014

    @jornh
    Contributor

    Duh I'm too slow - @amaitland Got there first with a better description 😜 ... still ...

    That CefSharp cares (warns/complains) about the platform is due to this recent addition https://github.com/cefsharp/CefSharp/pull/526/files we added it because Platform == either x86 or x64 is currently needed to determine the right CEF unmanaged DLLs to pick during build.

    I have VS2013 update 3 too (Professional). Set the Platform on the solution level in the 'Configuration Manager' dialog too, so it gets added to your .sln file. After that you should also have it in the project leveI build settings. I guess we need a new FAQ item now... But let's get you guys running first!

  4. brfenske commented on Nov 6, 2014

    @brfenske
    Author

    Updating Configuration Manager and adding "x86" did the trick. I use that so seldom I forgot all about it. Thanks everyone. Eager to see how much better this is than the OOB IE browser control!

  5. amaitland commented on Nov 6, 2014

    @amaitland
    Member

    I guess we need a new FAQ item now

    Maybe even reference the FAQ item in the error description?

  6. jornh commented on Nov 6, 2014

    @jornh
    Contributor

    Not a bad idea at all - see the last note in https://github.com/cefsharp/CefSharp/wiki/Frequently-asked-questions#CefSharp_binaries (but stop when you end up in this issue the third time if you follow the link ;)

  7. AJDev77 commented on Nov 7, 2014

    @AJDev77

    @amaitland Thanks, this worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions