Microsoft Office Interop Assembly Links

I have an application developed in Visual Studio 2005 that I am deploying with ClickOnce. My solution contains two projects - the user interface layer encoded in VB, and the class library encoded in C #. My C # class library has code that uses assembly from Outlook and Excel (Microsoft.Office.Interop.Outlook and Microsoft.Office.Interop.Excel, both versions are 11). Here are my questions.

  • Although I have not found where this is indicated as absolute, I understand that you must have the appropriate versions of Office applications (Outlook / Excel) in order to install an application using Interop assemblies. Is it correct?

If (1. = Yes) Then

How would you deal with a situation in which your application uses Interop assemblies for only a few functions that will be used only by a few select from a common user base? Why should I require every user of my application to install Microsoft Office, if only some users will use these features? These Interop assemblies are only DLL files, so what makes them so different from others that you cannot just publish the file in your project and satisfy this link no matter what software is installed on the client? (Clearly, I have a poor understanding of the GAC, and this affects the behavior of Visual Studio.) I would be happy to write my own code to check for the availability of the necessary Office software for several functions,who use them. No Office, no access to features ...

Else

If my understanding of this is wrong, then how do I configure my links and ClickOnce settings so that users do not encounter the following error when trying to install?

"Cannot install or run the application. The application requires that the build server version 11.0.0.0 be installed in the global assembly cache (GAC).

Contact your system administrator.

  • I tried setting the CopyLocal property for Interop to both True and False.
  • In my list of ClickOnce application files, I tried setting these assemblies to Include, Exclude, and Preququisite.
  • , , * C:\WINDOWS\assembly\GAC *, * C:\Program Files\Microsoft Visual Studio 9.0\Visual Studio Tools for Office\PIA\Office11 *, . http://msdn.microsoft.com/en-us/library/ez524kew(VS.80).aspx, GAC, ?
  • * C:\Program Files\Microsoft Visual Studio 9.0\Visual Studio Tools Office\PIA\Office11 * .

, , , , / GAC.

, , . , . , , .

, . !

+5
5

NetOffice: http://netoffice.codeplex.com/.

( MIT) ( 2000-2010 Office) . PIA , , , , .

, IntelliSense , Office .

.

+8

, - . ClickOnce, GAC, (, - GAC, ), , Office, , - , Office 13 , , .

, interop, pinvoke Office COM, ( ). (, , PIA, , ClickOnce ), .

, , , , - , ? , - , ...

+2

( , ClickOnce, , ):

API Excel 2003 Excel 2007, , Excel 2007 Excel 2003. , API , . , , .

. Excel 2003 Excel 2007, Interop Excel 2007.

SpreadsheetGear for.NET, Excel Windows Forms, .NET, - Office.

, .

: SpreadsheetGear LLC

+1
+1

COM . VB.NET . Marshal.GetActiveObject() Object. VB.NET, , #.

With C #, you get late binding if you use the reflection API, but it is rather difficult to write code using this. In C # 4, you can also get late binding through a dynamic type.

If you do this, you don’t need to distribute any Office assemblies, and your code will work until the attributes of the objects in the Office API change.

Late binding code is slower than early binding code, but for many purposes this is not a problem.

0
source

All Articles