I am viewing code that I have found from here. When I open the downloaded source code project in vs12, everything works fine. But when I copy the class into my own project there is an error (red squiggly line) under
WIA.ImageFile image = (WIA.ImageFile)wiaCommonDialog.ShowTransfer(item, wiaFormatBMP, false);
All references have been added as far as I can tell. The error description is: "One or more types required to compile a dynamic expression cannot be found. Are you missing a reference?"
Any Idea why this is happening and how to fix it?
Where you have copy/pasted the code, make sure target .Net Framework
for that project is 4.0 or above (4.5)
.
EDIT
You get this error when attempting to compile a solution that uses dynamic types in .NET.
It’s highly unlikely your project is missing a reference to System.Core.dll
if you are using Visual Studio. Usually this occurs when the project does not have a reference to Microsoft.CSharp.dll
. Add this reference to the references folder and recompile.