如何通过在本地计算机上运行的c#应用程序访问App-v上安装的Visio?

问题描述:

大家好!

在我的本地计算机上,我有Microsoft技术用于虚拟化应用程序(App-v)。

在App-v,虚拟化平台上,我安装了包含Visio的Microsoft Office套件。我在本地计算机上运行Visio作为所有其他Office应用程序没有任何问题。

我写了一个c#应用程序来自动化一些Visio绘图。我的应用程序在我的本地计算机上运行并使用引用:Microsoft.Interop.Office.visio。

我在此阶段遇到错误:Microsoft.Office.Interop.Visio.Application application =( Microsoft.Office.Interop.Visio.Application)Marshal.GetActiveObject( Visio.Application);

说操作不可用。

我知道我的本地计算机上没有安装visio,但它在我的本地计算机上运行(并且在正在运行的进程的任务管理器列表中有进程调用visio.exe)。如何在引用中使用上面的字符串时运行它?

任何人都知道如何更正此错误?

感谢您的贡献。

Hello all!
On my local computer i have Microsoft technology for virtualizing application(App-v).
On App-v, the virtualization platform, i have Microsoft Office suite including Visio installed. I run Visio as all others Office apllications on my local machine without any issue.
I wrote a c# application to automate some Visio drawings. My application is running on my local machine and use the reference: Microsoft.Interop.Office.visio.
I got an error at this stage: " Microsoft.Office.Interop.Visio.Application application = (Microsoft.Office.Interop.Visio.Application)Marshal.GetActiveObject("Visio.Application");"
saying "operation not available".
I'm aware that visio is not installed on my local machine but it runs on my local machine(and there is process call visio.exe in the task manager list of running processes) . How to make it runs while using the above string in quote?
Anyone have an idea on how to correct this error please?
Thanks all for your contributions.

如果Access数据库安装在虚拟机或真实数据库上,那么根本没关系机。您可以像安装在网络中某处的任何Access数据库一样访问它。

相应地调整连接字符串。可能需要为数据库文件所在的文件夹创建共享。
It does not matter at all if that Access database is installed on a virtual machine or a real machine. You can access it like any Access database installed somewhere in the network.
Adjust the connection string accordingly. It could be necessary to create a share for the folder the database file is located in.