Can not find System.Windows Assembly

谁说我不能喝 提交于 2019-11-30 08:07:20

In my case there was no System.Windows reference available to pick up.
I had to include a reference to WindowsBase

Add the assembly reference as you'd add any other framework assembly reference:

  • Right-click on the project
  • Select "Add reference"
  • Select the .NET tab on the left, and find "System.Windows" in the list of assemblies
  • Double-click on "System.Windows" and the assembly reference will be added

Add System.Windows assembly reference:

  • Right-click on the project
  • Select "Add reference"
  • Select the .NET tab on the left, and find "System.Windows" in the list of assemblies
  • Double-click on "System.Windows" to add it

If this does not solve the issue try Adding PresentationFramework, PresentationCore and WindowsBase assemblies (.NET 3.5)

We found it we had to go into the Silverlight folder and found the System.Windows.dll and now all is good thanks for the help though!

I had this occur on a machine with VS 2010 once before. For some reason, the System.Windows assembly was not found in the .NET tab of Add Reference window. Very strange.

In this case, you will just have to go to the Browse tab and navigate to:

C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Windows\

Once there, select the proper version subfolder (should look something like... v4.0_4.0.0.0__b03f5f7f11d50a3a) and then choose the System.Windows.dll there.

Right click on your "References" folder and click "Add Reference" and then select System.Windows under the .NET tab.

I've found the needed WindowsBase.dll in

C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0

well, it was actually system.windows.presentation in my wpf app...

If you don't have System.Windows in your .NET references, try WindowsBase. That fixed my reference to System.Windows.Point in VS 2008.

If you are using .NET Framework 2.0, referencing

System.Windows.Forms

(and using the namespace with the identical name) will do the job too

I had the same problem, however it was caused because we are using a Portable Class library and only occurred on certain PC installations.

I found the issue to be fixed on these installation with:

http://www.microsoft.com/en-us/download/details.aspx?id=3556

As this fix is included with VS2010 and Windows Update it would only occur on certain PCs.

Add the same references in your test project as you see as references in the project you are testing.

I got something like this and added:

PresentationCore PresentationFramework WindowsBase

Now it seems to stay quiet.

You have to add the reference to the project. If you're using Visual Studio, right-click the project in the Solution Explorer, and choose Add Reference...

You'll also run into this error if you use the Portable Library Tools as it's not supported.

Try with adding PresentationCore.dll After it you can use System.Windows namespace

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!