I'm working on a legacy project, and through debugging and re-engineering i stumbled upon the following error.
The documents are send to the location http://localhost:8080/Files
In the existing application it is handled like this
1 var path = Export.Path; <- in Debug it is `http://localhost:8080/Files`
2 Directory.SetCurrentDirectory(path);
At Line 2 the following Exception is thrown:
System.ArgumentException
HResult=-2147024809
Message=URI-Formate not supported.
Source=mscorlib
StackTrace:
in System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
in System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
in System.IO.Path.GetFullPathInternal(String path)
in System.IO.Directory.SetCurrentDirectory(String path)
in Controller.cs:Line 125.
in lambda_method(Closure , Object , Object[] )
in System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass13.<GetExecutor>b__c(Object instance, Object[] methodParameters)
in System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
in System.Web.Http.Controllers.ReflectedHttpActionDescriptor.<>c__DisplayClass5.<ExecuteAsync>b__4()
in System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancellationToken)
InnerException:
The directory exists and I can access it via the url-line in the browser. I searched through multiple solutions but found nothing that fits my problem.
Related
Server Error in '/' Application.
Access to the path '$(sourceFolder)\Foundation\Articles\serialization' is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access to the path '$(sourceFolder)\Foundation\Articles\serialization' is denied.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via , the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET access to a file, right-click the file in File Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[UnauthorizedAccessException: Access to the path '$(sourceFolder)\Foundation\Articles\serialization' is denied.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +435
System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost) +1436
System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost) +98
Rainbow.Storage.SerializationFileSystemDataStore.InitializeRootPath(String rootPath) +346
Rainbow.Storage.SerializationFileSystemDataStore..ctor(String physicalRootPath, Boolean useDataCache, ITreeRootFactory rootFactory, ISerializationFormatter formatter) +236
lambda_method(Closure , Object[] ) +246
Configy.Containers.MicroContainer.Activate(Type type, KeyValuePair`2[] unmappedConstructorParameters) +841
Unicorn.Configuration.<>c__DisplayClass8_0.<RegisterConfigTypeInterface>b__3() +41
System.Lazy`1.CreateValue() +734
System.Lazy`1.LazyInitValue() +189
Unicorn.Data.ConfigurationDataStore.RegisterForChanges(Action`2 actionOnChange) +19
Unicorn.Data.DataProvider.UnicornDataProvider..ctor(ITargetDataStore targetDataStore, ISourceDataStore sourceDataStore, IPredicate predicate, IFieldFilter fieldFilter, IUnicornDataProviderLogger logger, IUnicornDataProviderConfiguration dataProviderConfiguration, ISyncConfiguration syncConfiguration, PredicateRootPathResolver rootPathResolver) +549
lambda_method(Closure , Object[] ) +402
Configy.Containers.MicroContainer.Activate(Type type, KeyValuePair`2[] unmappedConstructorParameters) +841
Configy.Containers.MicroContainer.Resolve() +110
System.Linq.WhereSelectArrayIterator`2.MoveNext() +145
System.Linq.Buffer`1..ctor(IEnumerable`1 source) +284
System.Linq.Enumerable.ToArray(IEnumerable`1 source) +90
Unicorn.Data.DataProvider.UnicornSqlServerDataProvider..ctor(String connectionString) +222
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +223
Sitecore.Reflection.ReflectionUtil.CreateObject(Type type, Object[] parameters) +119
Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert) +108
Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +163
Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) +72
Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert) +703
Sitecore.Configuration.DefaultFactory.CreateFromReference(XmlNode configNode, String[] parameters, Boolean assert) +170
Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +116
Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) +72
Sitecore.Configuration.DefaultFactory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert) +947
Sitecore.Configuration.DefaultFactory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +545
Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +326
Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) +72
Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert) +703
Sitecore.Configuration.DefaultFactory.GetDatabase(String name, Boolean assert) +157
Sitecore.XA.Foundation.Multisite.Providers.SxaSiteProvider.GetSiteList() +51
Sitecore.XA.Foundation.Multisite.Providers.SxaSiteProvider.InitializeSites() +105
Sitecore.XA.Foundation.Multisite.Providers.SxaSiteProvider.GetSites() +18
System.Linq.<SelectManyIterator>d__17`2.MoveNext() +265
Sitecore.Sites.SiteCollection.AddRange(IEnumerable`1 sites) +221
Sitecore.Sites.SitecoreSiteProvider.GetSites() +258
Sitecore.Sites.DefaultSiteContextFactory.GetSites() +253
Sitecore.XA.Foundation.Multisite.SiteInfoResolver.get_Sites() +60
Sitecore.XA.Foundation.Multisite.Pipelines.Initialize.InitSiteManager.Process(PipelineArgs args) +85
(Object , Object ) +9
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +490
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +236
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
Sitecore.Nexus.Web.HttpModule.Application_Start() +220
Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +1165
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +584
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +168
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +277
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +369
[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +532
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +111
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +724
Iv tried suggestions taken from the following:
Problems with error: "Access to the path is denied."
1) Open Internet Information Systems (IIS) Manager
2) Expand the site you want to modify (hit the plus next to the name)
3) Right-click the directory where you would like to be able to write files and select Edit Permissions
4) Click on the Security tab
5) Click on Edit... under the group and users list
6) Select IIS_IUSRS from the "Groups or user names" list and add make sure the Allow checkbox is marked for Write.
ASP.NET is not authorized to access the requested resource when accessing temp folder
a really simple fix to solve my issue, in IIS I had to right click on Application Pools and set .NET Framework V4 to Integrated rather than classic/.
Another solution was to set the specific folder that was being accessed to read/write to the users that required it, this can be done by unique users or within an organization, a group of users
(https://stackoverflow.com/a/47503132/19587900)
(1) I have gone to wwwroot folder. Right-click and security tab. Provided IISUSER to set read and write permission to the wwwroot folder.
(2) Changed the application pool to the separate pool and set identity to Application pool Identity.
Iv tried other things but so far no success
Looks like you're trying to create a folder that starts with "$(sourceFolder)", that's not going to work well. Are you missing a variable definition like:
<sc.variable name="sourceFolder" set:value="c:\whatever" />
I am trying to work some examples with the AWS CDK using C# as the language. My platform is Windows 10. Edit: I forgot to mention, I'm using a 64-bit Windows 10 and I have 16 GB of RAM.
I've followed the Getting Started instructions here: Getting Started With the AWS CDK, including making sure I have all the prerequisites.
I can create a project just fine, but when I try to use synth or deploy, it get the following:
Unhandled exception. Amazon.JSII.Runtime.JsiiException: Child process exited unexpectedly:
#
# Fatal process OOM in insufficient memory to create an Isolate
#
at Amazon.JSII.Runtime.Services.Runtime.ReadResponse()
at Amazon.JSII.Runtime.Services.Client.ReceiveResponse[TResponse]()
at Amazon.JSII.Runtime.Services.Client.Hello()
at Amazon.JSII.Runtime.Services.ServiceContainer.BuildServiceProvider(ILoggerFactory loggerFactoryOverride)
at Amazon.JSII.Runtime.Services.ServiceContainer.<>c.<.cctor>b__8_0()
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at System.Lazy`1.get_Value()
at Amazon.JSII.Runtime.Services.ServiceContainer.get_ServiceProvider()
at Amazon.JSII.Runtime.Deputy.JsiiTypeAttributeBase.Load(Assembly assembly)
at Amazon.JSII.Runtime.Deputy.JsiiTypeAttributeBase.Load(Assembly assembly)
at Amazon.JSII.Runtime.Deputy.JsiiTypeAttributeBase..ctor(Type nativeType, String fullyQualifiedName)
at Amazon.JSII.Runtime.Deputy.JsiiClassAttribute..ctor(Type nativeType, String fullyQualifiedName, String parametersJson)
at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, RuntimeType type, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, RuntimeType type, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder`1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1 derivedAttributes)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
at System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean inherit)
at System.Attribute.GetCustomAttributes(MemberInfo element, Type type, Boolean inherit)
at System.Attribute.GetCustomAttribute(MemberInfo element, Type attributeType, Boolean inherit)
at System.Reflection.CustomAttributeExtensions.GetCustomAttribute[T](MemberInfo element)
at Amazon.JSII.Runtime.ReflectionUtils.GetClassAttribute(Type type)
at Amazon.JSII.Runtime.Deputy.DeputyBase..ctor(DeputyProps props)
at Amazon.CDK.Construct..ctor(DeputyProps props)
at Amazon.CDK.App..ctor(IAppProps props)
at CdkHello.Program.Main(String[] args) in C:\VSTS\Sandbox\Hampson\cdk-hello\src\CdkHello\Program.cs:line 12
Subprocess exited with error 3762504530
Program.cs, line 12 is a generated line, unchanged from it's initial form.
I have searched repeatedly for this error, and all the search results point to node.js. But none of the solutions (all involving some form of setting max-old-space-size) work to clear this for me. As far as I can tell, all my Node and JS installs, as well as the CDK install are up to date.
I can repeatedly duplicate this by creating a new project, then trying to run synth or deploy on it:
cdk init app --language csharp
cdk synth
I've been struggling with this for several days and have no more ideas. Any suggestions would be welcome.
I am learning C# so I apologise if I cannot be extremely precise in describing the error.
I was following Pluralsight course and at the section of Unit Testing I realised that the Unit Test does not run on my projects.
It casts the following error:
[19/11/2018 22:13:26 Error] Failed to launch testhost with error: System.AggregateException: One or more errors occurred. ---> Microsoft.Build.Exceptions.InvalidProjectFileException: The project file could not be loaded. Could not find file 'C:\Users\Daniele\source\repos\DateTime\UnitTestProject1\bin\x86\Debug\UnitTestProject1.build.appxrecipe'. C:\Users\Daniele\source\repos\DateTime\UnitTestProject1\bin\x86\Debug\UnitTestProject1.build.appxrecipe ---> System.IO.FileNotFoundException: Could not find file 'C:\Users\Daniele\source\repos\DateTime\UnitTestProject1\bin\x86\Debug\UnitTestProject1.build.appxrecipe'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
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)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Microsoft.Build.Internal.XmlReaderExtension..ctor(String file)
at Microsoft.Build.Construction.ProjectRootElement.LoadDocument(String fullPath, Boolean preserveFormatting)
--- End of inner exception stack trace ---
at Microsoft.Build.Shared.ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(Boolean condition, String errorSubCategoryResourceName, BuildEventFileInfo projectFile, Exception innerException, String resourceName, Object[] args)
at Microsoft.Build.Construction.ProjectRootElement.LoadDocument(String fullPath, Boolean preserveFormatting)
at Microsoft.Build.Construction.ProjectRootElement..ctor(String path, ProjectRootElementCache projectRootElementCache, Boolean preserveFormatting)
at Microsoft.Build.Construction.ProjectRootElement.CreateProjectFromPath(String projectFile, ProjectRootElementCache projectRootElementCache, Boolean preserveFormatting)
at Microsoft.Build.Construction.ProjectRootElement.<>c.<OpenProjectOrSolution>b__201_0(String path, ProjectRootElementCache cache)
at Microsoft.Build.Evaluation.ProjectRootElementCache.Get(String projectFile, OpenProjectRootElement openProjectRootElement, Boolean isExplicitlyLoaded, Nullable`1 preserveFormatting)
at Microsoft.Build.Construction.ProjectRootElement.OpenProjectOrSolution(String fullPath, IDictionary`2 globalProperties, String toolsVersion, ProjectRootElementCache projectRootElementCache, Boolean isExplicitlyLoaded)
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary`2 globalProperties, String toolsVersion)
at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.RecipeFile.get_Project()
at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.RecipeFile.get_Architecture()
at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.Deployer.Microsoft.VisualStudio.UwpTestHostRuntimeProvider.IDeployer.get_DeploymentArchitecture()
at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.UwpTestHostManager.<LaunchHostAsync>d__35.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.UwpTestHostManager.<Microsoft-VisualStudio-TestPlatform-ObjectModel-Host-ITestRuntimeProvider-LaunchTestHostAsync>d__30.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources)
---> (Inner Exception #0) Microsoft.Build.Exceptions.InvalidProjectFileException: The project file could not be loaded. Could not find file 'C:\Users\Daniele\source\repos\DateTime\UnitTestProject1\bin\x86\Debug\UnitTestProject1.build.appxrecipe'. C:\Users\Daniele\source\repos\DateTime\UnitTestProject1\bin\x86\Debug\UnitTestProject1.build.appxrecipe ---> System.IO.FileNotFoundException: Could not find file 'C:\Users\Daniele\source\repos\DateTime\UnitTestProject1\bin\x86\Debug\UnitTestProject1.build.appxrecipe'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
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)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Microsoft.Build.Internal.XmlReaderExtension..ctor(String file)
at Microsoft.Build.Construction.ProjectRootElement.LoadDocument(String fullPath, Boolean preserveFormatting)
--- End of inner exception stack trace ---
at Microsoft.Build.Shared.ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(Boolean condition, String errorSubCategoryResourceName, BuildEventFileInfo projectFile, Exception innerException, String resourceName, Object[] args)
at Microsoft.Build.Construction.ProjectRootElement.LoadDocument(String fullPath, Boolean preserveFormatting)
at Microsoft.Build.Construction.ProjectRootElement..ctor(String path, ProjectRootElementCache projectRootElementCache, Boolean preserveFormatting)
at Microsoft.Build.Construction.ProjectRootElement.CreateProjectFromPath(String projectFile, ProjectRootElementCache projectRootElementCache, Boolean preserveFormatting)
at Microsoft.Build.Construction.ProjectRootElement.<>c.<OpenProjectOrSolution>b__201_0(String path, ProjectRootElementCache cache)
at Microsoft.Build.Evaluation.ProjectRootElementCache.Get(String projectFile, OpenProjectRootElement openProjectRootElement, Boolean isExplicitlyLoaded, Nullable`1 preserveFormatting)
at Microsoft.Build.Construction.ProjectRootElement.OpenProjectOrSolution(String fullPath, IDictionary`2 globalProperties, String toolsVersion, ProjectRootElementCache projectRootElementCache, Boolean isExplicitlyLoaded)
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary`2 globalProperties, String toolsVersion)
at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.RecipeFile.get_Project()
at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.RecipeFile.get_Architecture()
at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.Deployer.Microsoft.VisualStudio.UwpTestHostRuntimeProvider.IDeployer.get_DeploymentArchitecture()
at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.UwpTestHostManager.<LaunchHostAsync>d__35.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.UwpTestHostManager.<Microsoft-VisualStudio-TestPlatform-ObjectModel-Host-ITestRuntimeProvider-LaunchTestHostAsync>d__30.MoveNext()<---
[19/11/2018 22:13:26 Informational] ========== Run test finished: 0 run (0:00:00.0535907) ==========
I have found different resources online
https://developercommunity.visualstudio.com/content/problem/212059/unable-to-debug-unit-test-visual-studio-enterprise.html
And different solutions:
first to disable a VPN (which I don't have) and then to Run “set-mppreference -EnableNetworkProtection 0” in an elevated PowerShell prompt, and restart VS.
None of this method has ultimately work and I am unable to run any test.
The problem is the appxrecipe is not in the bin folder of your unit test project.
You can create the appxrecipe file by creating an app package for the unit test project. To create the app package right click your unit test project > "Store" > "Create App Packages".
Once that is complete the appxrecipe file should be in the bin folder of your project and visual studio should be able to run your unit tests.
I have a jpg in a folder in my project. I want to make a bitmap out of it but it says my path is invalid when I try to refer to the jpg.
https://i.stack.imgur.com/dAWIG.jpg
Console Exception:
Unhandled Exception: System.ArgumentException: Illegal characters in path.
at System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.GetFullPathInternal(String path)
at System.IO.Path.GetFullPath(String path)
at System.Drawing.IntSecurity.UnsafeGetFullPath(String fileName)
at System.Drawing.IntSecurity.DemandReadFileIO(String fileName)
at System.Drawing.Bitmap..ctor(String filename)
at ConsoleImageCompare.Compare.differance(String img1, String img2) in c:\users\user\documents\visual studio 2017\Projects\ConsoleImageCompare\ConsoleImageCompare\Compare.cs:line 22
at ConsoleImageCompare.Program.Main(String[] args)
The reason is by default console application points to the bin/debug folder.So you need to go up two level to get the file
#"../../image/<Your File name>"
Use this
Good Day. I have a COM dll which registered using regsvr32 utility. When I tried to add reference to a project, the library is visible in reference list but when I press OK button the error occurs (STG_E_PATHNOTFOUND). Also popup hint on reference in browser shows correct path and dll not moved anywhere from it's registered location. Project and dll have same x64 bitness.
StackTrace
Error 1 The "ResolveComReference" task failed unexpectedly.
System.IO.DirectoryNotFoundException: The path could not be found. (Exception from HRESULT: 0x80030003 (STG_E_PATHNOTFOUND))
Server stack trace:
at System.Runtime.InteropServices.ComTypes.ITypeLib.GetDocumentation(Int32 index, String& strName, String& strDocString, Int32& dwHelpContext, String& strHelpFile)
at System.Runtime.InteropServices.Marshal.GetTypeLibName(ITypeLib typelib)
at Microsoft.Build.Tasks.ComReference.GetTypeLibNameForITypeLib(TaskLoggingHelper log, Boolean silent, ITypeLib typeLib, String typeLibId, String& typeLibName)
at Microsoft.Build.Tasks.ComReferenceInfo.InitializeWithPath(TaskLoggingHelper log, Boolean silent, String path, ITaskItem originalTaskItem, String targetProcessorArchitecture)
at Microsoft.Build.Tasks.ComReferenceInfo.InitializeWithTypeLibAttrs(TaskLoggingHelper log, Boolean silent, TYPELIBATTR tlbAttr, ITaskItem originalTaskItem, String targetProcessorArchitecture)
at Microsoft.Build.Tasks.ResolveComReference.ConvertAttrReferencesToComReferenceInfo(List`1 projectRefs, ITaskItem[] typeLibAttrs)
at Microsoft.Build.Tasks.ResolveComReference.Execute()
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.Build.Framework.ITask.Execute()
at Microsoft.Build.CommandLine.OutOfProcTaskAppDomainWrapperBase.InstantiateAndExecuteTask(IBuildEngine oopTaskHostNode, LoadedType taskType, String taskName, String taskLocation, String taskFile, Int32 taskLine, Int32 taskColumn, AppDomainSetup appDomainSetup, IDictionary`2 taskParams)