VSTO 2005 Beta2 Publish

When attempting to "Publish ..." a Word document VSTO project I am getting a warning stating:

C:\Program Files\MSBuild\Microsoft.VisualStudio.OfficeTools.targets : warning MSB3110: Assembly 'WordDocTest.dll.manifest' has mismatched identity 'WordDocTest.manifest', expected filename: 'WordDocTest.manifest.manifest'.

I can get the Publish to work for WinForms projects in the same fashion so my IIS seems to be setup properly. I get a 403 Forbidden error when trying to access the webpage even on the localhost.

[522 byte] By [BillKinney] at [2008-2-2]
# 1

Hi Bill,

Setting aside the warning that you receive for a moment, does the status bar indicate that the Publish command completed successfully?

It looks as if the warning that you are receiving has been bugged and I've also noticed the warning when publishing to a UNC share location as well as to an HTTP site, although I do receive notification that the Publish has completed successfully and am able to open the document and load the assembly from the published location once I setup the appropriate security policy(s).

Does the 403 message that you are receiving occur only with your VSTO project or are you also receiving this error when opening a WinForms project from the server?

If you have any questions please let me know via the posting.

Regards,

Ken Laws
MSFT

This posting is provided "AS IS" with no warranties, and confers no rights.

For more information regarding Visual Studio Tools for Office 2005:

Best of Blogs: Visual Studio 2005 Tools for Office
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_2003_ta/html/odc_landvsto2005_ta.asp

Visual Studio Tools for Office Forum
http://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=16

Visual Studio Tools for the Microsoft Office System
http://msdn.microsoft.com/office/understanding/vsto/default.aspx

KenLaws at 2007-9-8 > top of Msdn Tech,Visual Studio Tools for Office,Visual Studio Tools for Office...
# 2

Publishing the WinForms project works perfectly. I get a running application and no warning is produced.

When Publishing the VSTO 2005 Word Document project I get the warning along with the indication that the Publish command completed successfully.

If I need to setup the CAS for the Word Document project...can you elaborate on what permissions need to be set? Do I need full-trust, etc? Will I need this for the local machine as well as remote systems?

Thanks.

BillBQ at 2007-9-8 > top of Msdn Tech,Visual Studio Tools for Office,Visual Studio Tools for Office...
# 3
Hi Bill,

You can find out how to properly set permissions from the VSTO msdn help. There are a few pages that cover different scenarios you should be able to follow the walkthrouth to get you through the process. Here is the link
http://msdn2.microsoft.com/library/0c0116yz(en-us,vs.80).aspx

Thanks
Paul Stubbs
Program Manager - VSTO
http://blogs.msdn.com/pstubbs/

PaulStubbs at 2007-9-8 > top of Msdn Tech,Visual Studio Tools for Office,Visual Studio Tools for Office...
# 4
I tried following the steps in this article:
http://msdn2.microsoft.com/library/9w6bd8f1(en-us,vs.80).aspx

I ran into a problem when attempting to add Msosec.dll to the fully trusted assembly list. The dll in the list is with a lower-case 'm' (msosec.dll), not sure if that matters.

The error I get is:
"Unable to add the selected assembly. The assmebly must have a strong name (name, version and public key)." <OK>

Thanks again for any help,
Bill

BillKinney at 2007-9-8 > top of Msdn Tech,Visual Studio Tools for Office,Visual Studio Tools for Office...
# 5
Hi Bill,

I am seeing the same issue and I am working on an answer. I will get back to you as soon as resolve this.
Paul Stubbs
Program Manager
Microsoft
http://blogs.msdn.com/pstubbs/

PaulStubbs at 2007-9-8 > top of Msdn Tech,Visual Studio Tools for Office,Visual Studio Tools for Office...
# 6

Hi Bill,

I spoke to the author of that help article and he is going to update it for RTM. Int the meantime you can solve the msosec.dll issue by running capol from the command line. Install msosec in the GAC and then run this from the command window.

caspol.exe -polchgprompt on -machine -addgroup My_Computer_Zone -strong -file C:\windows\assembly\gac\msosec\7.0.5000.0__b03f5f7f11d50a3a\msosec.dll -noname -noversion FullTrust -name "msosec assembly" -description "Trust msosec based on signing key"

This will give the msosec.dll fulltrust.

Paul Stubbs
Program Manager
Microsoft
http://blogs.msdn.com/pstubbs/

See you at TechEd2005

PaulStubbs at 2007-9-8 > top of Msdn Tech,Visual Studio Tools for Office,Visual Studio Tools for Office...
# 7

That's progress but still doesn't solve running from a shared location.

I continued to follow the remaining steps in the article and they appear to execute properly. (Though I did have an occasional exception when running in the 2.0 Config UI).

I ran the steps using caspol and then tried running the VSTO 2005 project from the published area. I still get a runtime error:

The customization does not have the required permissions to execute.


************** Exception Text **************
System.Security.SecurityException: The customization does not have the required permissions to execute.
at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.LoadStartupAssembly(EntryPoint entryPoint, Dependency dependency, Dictionary`2 assembliesHash)
at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.ConfigureAppDomain()
at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.LoadAssembliesAndConfigureAppDomain(IHostServiceProvider serviceProvider)
at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.ExecuteCustomization(IHostServiceProvider serviceProvider)
The Zone of the assembly that failed was:
MyComputer


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50215/mscorlib.dll
-
msosec
Assembly Version: 7.0.5000.0
Win32 Version: 7.10.3191.0
CodeBase: file:///C:/WINDOWS/assembly/GAC/msosec/7.0.5000.0__b03f5f7f11d50a3a/msosec.dll
-
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
-
Microsoft.VisualStudio.Tools.Applications.Runtime
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50215.44
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Runtime/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Runtime.dll
-
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
-
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
-


BillKinney at 2007-9-8 > top of Msdn Tech,Visual Studio Tools for Office,Visual Studio Tools for Office...
# 8
Bill,

You should follow the directions on this page to give your solution permission to run.

http://msdn2.microsoft.com/library/zdc263t0(en-us,vs.80).aspx
Thanks

Paul Stubbs
Program Manager - VSTO
http://blogs.msdn.com/pstubbs/

PaulStubbs at 2007-9-8 > top of Msdn Tech,Visual Studio Tools for Office,Visual Studio Tools for Office...
# 9

I've tried setting up the permissions in every way possible from the previously mentioned articles. I continue to have problems running the assemblies. And yes, I have made sure Word is not running as I have rebooted a number of times. I notice after trying to run the published document lots of times the system eventually stops even attempting to load the assembly and just opens the document. When I reboot it is back to the issue below.

Could adding the msosec.dll be causing either of these problems?
"The customization assembly could not be found or could not be loaded. You can still edit and save the document. Contact the Administrator or the author of this document for further assistance.

Invalid URI: The format of the URI could not be determined.


************** Exception Text **************
System.UriFormatException: Invalid URI: The format of the URI could not be determined.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Uri..ctor(String uriString)
at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.LoadAndUpdateApplicationManifest(IAppInfo appInfo, Uri& newAppManifestPath, Boolean& appManifestDirty)
at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.CreateCustomizationDomainInternal(Uri uriFullDocumentDirectory, Uri uriFullDocFilePath, String documentName, IHostServiceProvider hostCallback, IAddinSecurityManager secman, AppManifest& applicationManifest, Boolean& manifestDirty, IAppInfo& appInfo)
at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.CreateCustomizationDomain(String applicationDomainPath, String documentName, IHostServiceProvider hostCallback, IExecuteCustomization& executor)
at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManager.CreateCustomizationDomain(String applicationDomainPath, String documentName, IHostServiceProvider hostCallback, IExecuteCustomization& executor)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50215/mscorlib.dll
-
Microsoft.VisualStudio.Tools.Applications.Runtime
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50215.44
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Runtime/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Runtime.dll
-
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
-
Microsoft.Office.Tools.Common
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50215.44
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.Office.Tools.Common/8.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.Common.dll
-
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
-


BillKinney at 2007-9-8 > top of Msdn Tech,Visual Studio Tools for Office,Visual Studio Tools for Office...
# 10
There are two problems you're experiencing here and both were fixed in the latest builds. First, the "mismatched identity" warning message was fixed along with several other Publish Wizard fixes. For the second issue, it appears that you have pre Beta2 build where loading assembly from HTTP was not working. Please update to a newer build of VSTO.
VadimVolkov at 2007-9-8 > top of Msdn Tech,Visual Studio Tools for Office,Visual Studio Tools for Office...