When i run the testcase c# application from windows(local machine) it works fine. But when run from azure pipeline getting below exception. Anyone faced like this error? Please help me on this.
i used code:
MagickImage sourceImage = new MagickImage("../../../Images/OutputImages/output-SlightSkew.jpg");
Got error:
Error Message:
ImageMagick.MagickBlobErrorException : UnableToOpenBlob '../../../Images/OutputImages/output-SlightSkew.jpg': No such file or directory # error/blob.c/OpenBlob/3537
Stack Trace:
at ImageMagick.NativeInstance.CheckException(IntPtr exception, IntPtr result)
at ImageMagick.MagickImage.NativeMagickImage.ReadFile(IMagickSettings1 settings) at ImageMagick.MagickImage.Read(String fileName, IMagickReadSettings1 readSettings, Boolean ping)
at ImageMagick.MagickImage.Read(String fileName, IMagickReadSettings`1 readSettings)
at ImageMagick.MagickImage.Read(String fileName)
at ImageMagick.MagickImage..ctor(String fileName)
According to your error message, the error is most likely due to the wrong file path.
In Azure DevOps pipeline, your source code files are in $(System.DefaultWorkingDirectory).
You can check if there is a output-SlightSkew.jpg file in ../../../Images/OutputImages/ in your repository.
If the answer is no, change your path to the correct path.
If the answer is yes, try to replace your path to a specific path, for example {folder A}/{folder B}/Images/OutputImages/output-SlightSkew.jpg.
Related
This is the error I'm getting when I am trying to build a solution. I tried commenting the Item groups individually one by one and fix the issue but it isn't solved.
Severity Code Description Project File Line Suppression State
Error The "ResolvePackageFileConflicts" task failed unexpectedly.
System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.IO.Path.GetFileName(String path)
at Microsoft.NET.Build.Tasks.ItemUtilities.GetTargetPath(ITaskItem item)
at Microsoft.NET.Build.Tasks.ItemUtilities.GetReferenceTargetPath(ITaskItem item)
at Microsoft.NET.Build.Tasks.ConflictResolution.ResolvePackageFileConflicts.<>c.<ExecuteCore>b__44_7(ConflictItem ci)
at Microsoft.NET.Build.Tasks.ConflictResolution.ConflictResolver`1.ResolveConflicts(IEnumerable`1 conflictItems, Func`2 getItemKey, ConflictCallback`1 foundConflict, Boolean commitWinner)
at Microsoft.NET.Build.Tasks.ConflictResolution.ResolvePackageFileConflicts.ExecuteCore()
at Microsoft.NET.Build.Tasks.TaskBase.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() CocoonIT
I'm trying to build a solution and was getting this error and I'm not sure how to resolve it.
I have tried commenting the ItemGroups one by one in the csproj file but it didn't solve this.
Could you please help me in resolving this
I have a path that uses some unc paths in the background such as:
\\crfile2\..some folders..\myFile.lbp
and needs to check if the file exists (won't exist in many cases). I have a simple check that reads the file if it exists. It works fine on almost all cases, but I have one customer that is getting an error:
Unhandled Error: Invalid URI: The format of the URI could not be determined.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at RDES.Common.RDLicenseCommon.LicenseBypassData.<GetBypassData>b__0(String x)
at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
This seems like a valid UNC path correct? I'm not sure where the error is here, and even more so I find it confusing that my machine and hundreds of others use the same path string with no issues but this one user is getting this issue. I know it's very limited because for him it's cause a crash on startup and the program is used by enough people that when I post something with a critical issue like that I know it from many people in very short order (not that I ever have posted anything like that...). Anyway any help would be appreciated.
Here is the code line where the exception is being thrown:
string myPath = AllValidPaths.Where(x => VerifyFileExists(new Uri(x),500)).FirstOrDefault();
You can see by the stack that the exception is being thrown by the constructor of the URI inside of the lambda expression.
I'm learning Roslyn and trying it out for the first time. I've written a small code snippet to load a solution and get a reference to a workspace.
IWorkspace workspace = Workspace.LoadSolution(solutionPath);
foreach (IProject project in workspace.CurrentSolution.Projects)
{
CommonCompilation objCompilation = project.GetCompilation();
}
return workspace;
But I'm getting an exception in the first line. The exception details are given below.
Message : Expected Global Line.
stack trace : at
Roslyn.Services.Host.SolutionFile.ParseGlobal(TextReader reader)
at Roslyn.Services.Host.SolutionFile.Parse(TextReader reader) at
Roslyn.Services.Host.LoadedWorkspace.LoadSolution(SolutionId
solutionId, String filePath) at
Roslyn.Services.Host.LoadedWorkspace.OpenSolution(String fileName)
at Roslyn.Services.Host.LoadedWorkspace.LoadSolution(String
solutionFileName, String configuration, String platform, Boolean
enableFileTracking) at
Roslyn.Services.Workspace.LoadSolution(String solutionFileName, String
configuration, String platform, Boolean enableFileTracking) at
Ros2.Program.GetWorkspace(String solutionPath) in
c:\users\amnatu\documents\visual studio
2015\Projects\Ros2\Ros2\Program.cs:line 30
I referred to this link which shows the same issue that I faced. However, the solution of removing the space between EndProject and Global isn't really applicable in my case as my solution file doesn't have any space between them.
Am I missing anything here?Any suggestions on how to resolve this issue?
Apologies for the delayed response. The comment by #JoshVarty helped me understand the issue.
I was indeed using the out dated version and had to use the latest Microsoft.CodeAnalysis library. After I made these changes and updated all classes accordingly, everything worked perfectly.
Thanks JoshVarty.!
I'm trying to turn of Anonymous authentication on a site using c#
This code throws exception written at bottom i searched everywhere i cant find answer how to solve it:
using (ServerManager serverManager = new ServerManager())
{
Configuration configapp = serverManager.GetApplicationHostConfiguration();
ConfigurationSection anonymousAuthenticationSection = configapp.GetSection("system.webServer/security/authentication/anonymousAuthentication", Site1);
anonymousAuthenticationSection["enabled"] = false;
serverManager.CommitChanges();
}
The exception:
System.IO.FileNotFoundException: Filename: \\?\C:\Windows\system32\inetsrv\config\applicationHost.config
Error: Unrecognized configuration path 'MACHINE/WEBROOT/APPHOST/Site1'
at Microsoft.Web.Administration.Interop.AppHostWritableAdminManager.GetAdminSection(String bstrSectionName, String bstrSectionPath)
at Microsoft.Web.Administration.Configuration.GetSectionInternal(ConfigurationSection section, String sectionPath, String locationPath)
at Microsoft.Web.Administration.Configuration.GetSection(String sectionPath, String locationPath)
at FlowSuiteWebConfigurator.label.button1_Click(Object sender, EventArgs e) in C:\Users\Administrator\documents\visual studio 2010\Projects\Projectname\Projectname\Form1.cs:line 264
Can someone guide me how to fix this?
A bit late maybe (1 year and a half after...), but the problem seems to be in your location definition (2nd parameter of configapp.GetSection): the exception said Error: Unrecognized configuration path 'MACHINE/WEBROOT/APPHOST/Site1'
Tested locally on my machine, I have no exception with a valid location name like Default Web Site/MyCustomPortal.
Note: the reference added is Microsoft.Web.Administration.dll under C:\Windows\System32\inetsrv\ , and those lines of code look into the file applicationHost.config located in C:\Windows\System32\inetsrv\config
I have CruiseControl(1.5) running in Win2k8R2 and svn(1.6.9) The error happens on a successful build after nant(0.86) Timeout(600 seconds). When I check the build dir everything is built correctly but CruiseControl Dashboard report Exception
Here is the error shown in console:
[:DEBUG] Exception: System.Xml.XmlException: The ',' character, hexadecimal value 0x2C, cannot be included in a name. Line 5544, position 274.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ParseElement()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlWriter.WriteNode(XmlReader reader, Boolean defattr)
at ThoughtWorks.CruiseControl.Core.Util.XmlFragmentWriter.WriteNode(XmlReader reader, Boolean defattr)
at ThoughtWorks.CruiseControl.Core.Util.XmlFragmentWriter.WriteNode(String xml)
Generaly, this error happens when ccnet is trying to merge Nant ouput with non-xml info into the build report.
Verify the Nant ouput.
Maybe something similar here:
CruiseControl.Net complaining about xml