Outlook 2010 addin Access is denied - vsto

Im trying to create an outlook 2010 addin. I just created the standard project, when trying to run it i get the following error...
Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
***** Exception Text *******
System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
at System.Deployment.Internal.Isolation.IsolationInterop.GetUserStore(UInt32 Flags, IntPtr hToken, Guid& riid)
at System.Deployment.Internal.Isolation.IsolationInterop.GetUserStore()
at System.Deployment.Application.ComponentStore..ctor(ComponentStoreType storeType, SubscriptionStore subStore)
at System.Deployment.Application.SubscriptionStore..ctor(String deployPath, String tempPath, ComponentStoreType storeType)
at System.Deployment.Application.SubscriptionStore.get_CurrentUser()
at System.Deployment.Application.DeploymentManager..ctor(Uri deploymentSource, Boolean isUpdate, Boolean isConfirmed, DownloadOptions downloadOptions, AsyncOperation optionalAsyncOp)
at System.Deployment.Application.InPlaceHostingManager..ctor(Uri deploymentManifest, Boolean launchInHostProcess)
at Microsoft.VisualStudio.Tools.Applications.Deployment.IPHMProxy..ctor(Uri uri)
at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.get_Proxy()
at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.GetManifests(TimeSpan timeout)
at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.InstallAddIn()
Anyone have an idea about this?

You might have some problem in your Local Settings folder. Try deleting it, reboot and it will be recreated. That's how I've solved a few access denied errors when dealing with QlickOnce.
The Local Settings-folder is hidden default. It's found here on Windows 7 (and Vista):
C:\Users\{user name}\AppData\Local
And here on Windows XP:
C:\Documents and Settings\{user name}\AppData\Local

I got the same issue on one of my team mate's machine after installing setup of word addin. I created installer using Installshield's limited edition. The issue was in registry entry. Path in Manifest entry was having "file:///" at start which was somehow causing error.
First I manually changed path in manifest registry (at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Word\Addins\YourAddin\Manifest) from "file:///C:/Program Files (x86)/...../My.vsto" to "C:/Program Files (x86)/...../My.vsto" and it worked. Then I fixed that in my setup project too.
Hope this helps somene.

Related

Office Addin VSTO install error on a specific system

Our VSTO for installing our Office Word Addin works correctly on all systems tested so far, both in-house and on (almost) all customer systems.
However, on one customer system it is failing.
An attempt to manually install the VSTO results in this error message being displayed: 'Store metadata "ApplicationSourceUri" is not valid'.
We have checked for all the known requirements on the system (Addin certificate, trusted publisher flags in the registry, Office 2010 runtime, etc), but we have yet to find a cause. Online research has so far has not returned an answer.
Any help would be much appreciated!
A VSTO install log generated by Windows gives this error information:
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* An exception occurred while downloading the manifest. Following failure messages were detected:
+ Store metadata "ApplicationSourceUri" is not valid.
ERROR DETAILS
Following errors were detected during this operation.
* [27.04.2018 20:57:19] System.Deployment.Application.DeploymentException (SubscriptionState)
- Store metadata "ApplicationSourceUri" is not valid.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.ComponentStore.GetPropertyString(DefinitionAppId appId, String propName)
at System.Deployment.Application.ComponentStore.GetPropertyUri(DefinitionAppId appId, String propName)
at System.Deployment.Application.ComponentStore.GetSubscriptionStateInternal(DefinitionIdentity subId)
at System.Deployment.Application.SubscriptionStore.GetSubscriptionStateInternal(SubscriptionState subState)
at System.Deployment.Application.SubscriptionStore.CheckAndReferenceApplication(SubscriptionState subState, DefinitionAppId appId, Int64 transactionId)
at System.Deployment.Application.DeploymentManager.BindCore(Boolean blocking, TempFile& tempDeploy, TempDirectory& tempAppDir, FileStream& refTransaction, String& productName)
Try to remove a corresponding to your application a windows registry key (associated with application):
HKEY_CURRENT_USER\Software\Classes\Software\Microsoft\Windows\CurrentVersion\Deployment\SideBySide\2.0\PackageMetadata
Then try to re-build and publish it anew.

Running dotnet ef without Visual Studio throws an exception

I have a project that is a .NET Core console application with just a model and some seed data. On a development desktop I can go to the application directory, run dotnet ef database update and everything is fine (I need to copy appsettings.json to bin\... directory, but OK).
The problem is when I need to run this in the client environment (with VPN access, and without Visual Studio there). First, I am not sure what exactly I need to copy to the remote machine. But let's say, I copied the whole project. First, when I run, I get the following error:
Unhandled Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path '.nuget\packages.tools\Microsoft.EntityFrameworkCore.Tools'.
I have a directory .nuget\packages\Microsoft.EntityFrameworkCore.Tools but not under .tools. Out of despair I created .tools and copied this directory under it, but now I am getting the following exception:
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.DotNet.Cli.Utils.ProjectToolsCommandResolver. ResolveCommandSpecFromToolLibrary(LibraryRange toolLibraryRange, String commandName, IEnumerable`1 args, ProjectContext projectContext)
at Microsoft.DotNet.Cli.Utils.ProjectToolsCommandResolver. ResolveCommandSpecFromAllToolLibraries(IEnumerable`1 toolsLibraries, String commandName, IEnumerable`1 args, ProjectContext projectContext)
at Microsoft.DotNet.Cli.Utils.ProjectToolsCommandResolver. ResolveFromProjectTools(String commandName, IEnumerable`1 args, String projectDirectory)
at Microsoft.DotNet.Cli.Utils.ProjectToolsCommandResolver.Resolve (CommandResolverArguments commandResolverArguments)
at Microsoft.DotNet.Cli.Utils.CompositeCommandResolver.Resolve (CommandResolverArguments commandResolverArguments)
at Microsoft.DotNet.Cli.Utils.CommandResolver.TryResolveCommandSpec(String commandName, IEnumerable`1 args, NuGetFramework framework, String configuration, String outputPath)
at Microsoft.DotNet.Cli.Utils.Command.Create(String commandName, IEnumerable`1 args, NuGetFramework framework, String configuration, String outputPath)
at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient)
at Microsoft.DotNet.Cli.Program.Main(String[] args)
Clearly, my trial and error attempts to find the right way hit a wall. Is there some substantive (not just syntax) documentation as to how to run EF Core commands outside Visual Studio? .NET is version 1.1 if that matters
It seems that you have not removed Entity framework completly hence the error that path: .nuget\packages.tools\Microsoft.EntityFrameworkCore.Tools is not found.
Somewhere in code there must be a reference to this file. If you are using project.json try checking your tools and depenedencies for Microsoft.EntityFrameworkCore.Tools.
If you are using the .csproj SDK version. Check your project file for any of these references and remove them.

Cannot get SonarQube Scanner for MSBuild 2.2.0.24 working : Access to the path is denied on .cs file

I'm trying to get sonarqube analysis to run along with the build (msbuild 12) on TFS 2013 using a VS2013 (.net 4.5.2) solution. I have already setup a SonarQube server and successfully ran manual scans.
I'm using tfvcTemplate.12.xaml with pre-compile and post-compile script pointing to sonarqube.scanner.msbuild.exe on the build server (d:\sonarqubeMSbuild..) with corresponding begin and end parameters. I have enable verbose mode to help understand the problem.
I always get the following error stack on the failed tfs build log :
09:51:40.907 ERROR: Failed to analyze the file: D:\Builds\29\SD\ApplicationDemoTestsUnit_MAN\src\PreuvesDeConcept\TestsUnitaires\Application\CompteBancaire.cs
09:51:40.907 ERROR: System.UnauthorizedAccessException: Access to the path 'D:\Builds\29\SD\ApplicationDemoTestsUnit_MAN\src\PreuvesDeConcept\TestsUnitaires\Application\CompteBancaire.cs' is denied.
09:51:40.907 ERROR: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
09:51:40.907 ERROR: at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
09:51:40.907 ERROR: at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
09:51:40.907 ERROR: at SonarAnalyzer.Runner.CompilationHelper.GetSolutionFromFiles(String filePath, Encoding encoding, AnalyzerLanguage language)
09:51:40.907 ERROR: at SonarAnalyzer.Runner.Program.RunAnalysis(ScannerAnalyzerConfiguration conf)
09:51:40.985 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: The .NET analyzer failed with exit code: 1 - Verify that the .NET Framework version 4.5.2 at least is installed.
File access error is verified on the build server using process monitor:
High Resolution Date & Time: 2017-01-04 09:51:40,9043151
Event Class: File System
Operation: CreateFile
Result: ACCESS DENIED
Path: D:\Builds\29\SD\ApplicationDemoTestsUnit_MAN\src\PreuvesDeConcept\TestsUnitaires\Application\CompteBancaire.cs
TID: 5232
Duration: 0.0000914
Desired Access: Generic Read/Write
Disposition: Open
Options: Synchronous IO Non-Alert, Non-Directory File, Open No Recall
Attributes: n/a
ShareMode: None
AllocationSize: n/a
The identity trying to access the file is the domain service account my build agent runs under. This account has full access to file system and is administrator on the build machine.
Any ideas on this matter would be highly appreciated!
Thanks
We request Read/Write access to files, which is a mistake on our side. Here's the corresponding ticket to fix it: https://jira.sonarsource.com/browse/SLVS-1122.

Installing Office Customizations System.ArgumentException: Value does not fall within the expected range

I'm trying to deploy my Outlook Add-In to a Windows 10 Machine, but I always get this error after installation:
Name:
From: file:///C:/Users/Public/MycompanyOutlookAddIn.vsto
************** Exception Text **************
System.ArgumentException: Value does not fall within the expected range.
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
at Microsoft.VisualStudio.Tools.Office.Runtime.Interop.VSTOEENativeMethods.GetValidCompatibleFramework(String compatibleFrameworkXml)
at Microsoft.VisualStudio.Tools.Office.Runtime.CompatibleFrameworksValidation.ParseFirstValidFramework(String compatibleFrameworksXml)
at Microsoft.VisualStudio.Tools.Office.Runtime.OfficeAddInDeploymentManager.OnAddInManifestsDownloaded(AddInManifestsDownloadedArgs args)
at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.RaiseOnAddInManifestsDownloadedEvent(IClickOnceAddInInstaller addInInstaller, Uri deploymentManifestUri, AddInInstallationStatus addinSolutionState, String productName, String deploymentManifestXml, String applicationManifestXml, String hostManifestXml, String logFilePath, String version, Uri supportUri)
at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.InstallAddIn()
Some questions from years ago suggested that the path was too long, so I changed mine to the Public directory but I still get this error.
Another thing that I tried was running this:
rundll32 %windir%\system32\dfshim.dll CleanOnlineAppCache
but after reinstalling I get the same error.
Weird thing is that When I deploy to Windows 7 machines it works flawlessy. The Add-In was developed without much problems in Windows 8.1. I only get this error on Windows 10. Could somebody please tell me what is going on?
You must install the extension Visual Studio 2010 Tools for Office Runtime
Visual Studio 2010 Tools for Office Runtime

I can't compile a standard "WCF Service Library" in x86 format

If I start up Microsoft Visual Studio, create a standard "WCF Service Library", and compile it, it works perfectly.
However, if I go into Properties..Build and set the "Platform Target" to "x86", it won't compile. I need "x86" because I need to reference some .dll's that simply won't work if I choose "All Platforms".
-----start error-----
System.BadImageFormatException: Could not load file or assembly 'file:///D:\backtest\C#\WCF service\WcfServiceLibrary\bin\Debug\WcfServiceLibrary.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: 'file:///D:\backtest\C#\WCF service for\WcfServiceLibrary\bin\Debug\WcfServiceLibrary.dll'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at Microsoft.Tools.SvcHost.ServiceHostHelper.LoadServiceAssembly(String svcAssemblyPath)
=== Pre-bind state information ===
LOG: User = dr-satellite\Shane
LOG: Where-ref bind. Location = D:\backtest\C#\WCF service for\WcfServiceLibrary\bin\Debug\WcfServiceLibrary.dll
LOG: Appbase = file:///D:/backtest/C#/WCF service for/WcfServiceLibrary/bin/Debug
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: D:\backtest\C#\WCF service for\WcfServiceLibrary\bin\Debug\WcfServiceLibrary.dll.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Attempting download of new URL file:///D:/backtest/C#/WCF service for/WcfServiceLibrary/bin/Debug/WcfServiceLibrary.dll.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
-----end error-----
Your problem is actually the WCF Test Client complaining that your WCF Service Library is 32bit. This is because by default, the WCF Test Client always runs in 64 bit mode.
Rather than going to the lengths of changing to a WCF Service Application so you can debug, I found the following steps on this blog which makes the WCF Test Client run in 32bit mode - and therefore you will not see the error you have posted.
Copy WcfSvcHost.exe and WcfTestClient.exe from C:\program files (x86)\Microsoft Visual Studio 10.0\Common7\IDE to a local directory. Keep a backup copy of this file, of course.
Start a Visual Studio 2010 Command Prompt (one of the links from the start menu -> Visaul Studio 2010)
"cd" to the directory where your copy of WcfSvcHost is located.
Execute the command "corflags /32BIT+ /FORCE WcfSvcHost.exe"
Execute the command "corflags /32BIT+ /FORCE WcfTestClient"
Copy the files back to where you found it.
Now your WcfSvcHost and WcfTestClient will be running in 32 bit mode, and you can debug away!
I found two good methods to solve this:
Installing the 64-bit version of Matlab means you can compile 64-bit .dll's which are compatible with the 64-bit WCF Service Library. This removes the need to compile in 32-bit mode so it doesn't throw exceptions when it calls the 32-bit assembly. This solution works well.
There are two types of projects you can generate in MSVS 2010: "WCF Service Library" and "WCF Service Application". Although you cannot build and run a "WCF Service Library" in 32-bit mode (it only supports 64-bit), you can build and run a "WCF Service Application" in 32-bit mode.