mercoledì 8 giugno 2011

Unable to open module file 'C:\Users\[UserName]\AppData\Local \Temp\.NETFramework,Version=v4.0,Profile=Client.AssemblyAttributes.vb': File missing

Unable to open module file 'C:\Users\[UserName]\AppData\Local \Temp\.NETFramework,Version=v4.0,Profile=Client.AssemblyAttributes.vb': File missing

I don't know the exact cause of this strange compiler error. I checked the file and the file is there and the security is ok.
Anyway, to resolve this error set the following element to false in the .vbproj project file:

<PropertyGroup>
  <TrackFileAccess>false</TrackFileAccess>
</PropertyGroup>

Reload the project and build. 

Unable to open module file 'C:\Users\[NomeUtente]\AppData\Local \Temp\.NETFramework,Version=v4.0,Profile=Client.AssemblyAttributes.vb': Impossibile trovare il file specificato

Unable to open module file 'C:\Users\[NomeUtente]\AppData\Local \Temp\.NETFramework,Version=v4.0,Profile=Client.AssemblyAttributes.vb': Impossibile trovare il file specificato

Il motivo di questo errore di compilazione è ignoto. Il file è presente ed è accessibile.
La soluzione consiste nel aprire il file .vbproj del progetto che da errore e aggiungere questo elemento:

<PropertyGroup>
    <TrackFileAccess>false</TrackFileAccess>
</PropertyGroup>

Ricompilare ed il problema dovrebbe essere risolto

mercoledì 25 maggio 2011

Error when using Microsoft Office Word Interop from a webservice

When trying to run a webservice that needs to access the Word application you can get the following error: 

"Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005."

Set the user identity to the AppPool containing the WebService to someting like Local System or Word will not run properly. You may also need to install the Microsoft Primary Interop Assemblies.

If the error persists, you need to enable the com access to the use. Run "dcomcnfg" and go to Component Services -> Computers -> My Computer -> DCOM Config.

At the end of the list you will find "{00020906-0000-0000-C000-000000000046}" right click on it and select properties, go to Security and in "Launch and Activation Permissions" set Customize -> Edit and set the permissions for the user identity used by the AppPool containing the WebService.