Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
brfenske opened this issue Nov 5, 2014 · 7 comments
Closed

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

brfenske opened this issue Nov 5, 2014 · 7 comments

Comments

@brfenske
Copy link

brfenske commented Nov 5, 2014

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?

@AJDev77
Copy link

AJDev77 commented Nov 5, 2014

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.

@amaitland
Copy link
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.

@jornh
Copy link
Contributor

jornh commented Nov 6, 2014

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!

@brfenske
Copy link
Author

brfenske commented Nov 6, 2014

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!

@brfenske brfenske closed this as completed Nov 6, 2014
@amaitland
Copy link
Member

I guess we need a new FAQ item now

Maybe even reference the FAQ item in the error description?

@jornh
Copy link
Contributor

jornh commented Nov 6, 2014

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 ;)

@AJDev77
Copy link

AJDev77 commented Nov 7, 2014

@amaitland Thanks, this worked!

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

No branches or pull requests

4 participants