Using Saxon .NET XSLT processor does not work with intellisense in Visual Studio

孤街醉人 提交于 2019-12-23 12:23:54

问题


I am using the open source Saxon XSLT processor for .NET to execute some 2.0 transforms.

I reference the saxon9api.dll as I would any other dll, and can compile code against this. However Visual Studio does not show any intellisense making the IDE as useful as notepad.

The saxon9api.dll is using the IKVM Java for .NET platform, and I wonder if this is the causing VS a problem. Reflector can inspect the DLL without issue, but I suspect VS is not happy for some reason.

Any ideas?

EDIT:

Surprised that no one else has encountered this behaviour seeing as Microsoft recommends (link is now dead) the use of Saxon in the absense of built in functionality in the framework.

I think I will reword the question to be about assemblies running under IKVM not showing intellisense although I will need to find another IKVM based project to prove that this is the case first...


回答1:


To make compiling, running and intellisense work in Visual Studio, you need to do the following:

  • Reference saxon9api.dll, as you already did
  • Reference IKVM.OpenJDK.Core.dll
  • Reference IKVM.Runtime.dll (not sure this is needed, but I always include it)

If you are also referencing vjslib, you may run into issues, because it uses a lot of the same namespaces and classnames, leading to ambiguities that can cause Visual Studio's intellisense to get into problems. Perhaps other libraries exist that show the same namespace clashes. In that case, try this on a fresh project first and add the references one by one, starting with Saxon's dependencies first.

After you do this, at least in Visual Studio 2010, 2012 and 2013, you will find that the context-sensitive help is working (image is of VS 2012 with R#):


Note: since this post is old, it may have only applied to Visual Studio 2008 at the time, I have not tested that as I am not using it anyore.



来源:https://stackoverflow.com/questions/750841/using-saxon-net-xslt-processor-does-not-work-with-intellisense-in-visual-studio

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