开发者

Can't add system.media.imaging even after adding PresentationCore and WindowsBase

开发者 https://www.devze.com 2023-04-10 12:40 出处:网络
I\'ve just installed C# Visual Express 2010. The project is created under Console Application. Any ideas? Thanks.

I've just installed C# Visual Express 2010.

The project is created under Console Application.

Any ideas? Thanks.

I'm trying to copy a range in excel and save it as a image file.


I have both PresentationCore and WindowsBase in my References. But I'm still getting this error.

"Error 1 The type or namespace name 'Imaging' does not exist in the 开发者_C百科namespace 'System.Media' (are you missing an assembly reference?)"


Target Framwork is .NET Framework 3.5. It's still not working.


On versions of Visual Studio 2010, the default framework used for console applications is .NET Framework 4 Client Profile. The classes you're trying to use are probably not available for this version of the framework.

You need to change your project so it targets the full, .NET Framework 4 (or at least .NET Framework 3.5).

I don't have the express version installed to use as a reference but in regular versions of Visual Studio, you can do this by:

  1. Right clicking on your project in the solution explorer and select Properties.
  2. Under the Application tab, change the Target Framework from .NET Framework 4 Client Profile to .NET Framework 4.
  3. Save.

You'll probably have to reopen your project so the changes could take effect. The assemblies should then be available to you.

0

精彩评论

暂无评论...
验证码 换一张
取 消