specflow+ example test on mac os (x64) - c#

I am running specflow+ example test from here on mac catalina( x64) using Visual Studio for mac but I get this error
ExecutionThreadApartmentState option not supported for framework: .NETCoreApp,Version=v3.1.
Since apartmentState property is not supported on mac as mentioned here
I tried by removing apartmentState from <execution> element and also tried removing the whole <execution> element from Default.srprofile but still get same error in test results output. (test just keeps on running. Upon cancelling shows error in test output)
Tried x64 in platform settings in build but I get below when try to run test
Test run will use DLL(s) built for framework .NETCoreApp,Version=v3.1 and platform X86. Following DLL(s) do not match framework/platform settings.
TestApplication.UiTests.dll is built for Framework .NETCoreApp,Version=v3.1 and Platform X64.
Is it that the example tests mentioned above can not be run on mac os (x64) ? or am I missing some other thing?
EDIT
I installed and targeted .net core 3.0 and the still get
ExecutionThreadApartmentState option not supported for framework: .NETCoreApp,Version=v3.0.
EDIT2
The error I see in the logs is below. I think the above error about ExecutionThreadApartmentState may be just a warning because I still see it in test output
2020-04-29T13:55:54.5764790-04:00:Executing test executor at '/usr/bin/dotnet' 'exec "/Users/../Desktop/../projects/specflow/SpecFlow.Plus.Examples-master/SeleniumWebTest/TestApplication.UiTests/bin/Debug/netcoreapp3.0/SpecFlowPlusRunner/netcoreapp3.0/TechTalk.SpecRun.Framework.Executor.anycpu.netcoreapp3_0.dll" --remoteRunnerPid 37116 --uniqueId "2020-04-29T135554" --outputFolder "/Users/../Desktop/../projects/specflow/SpecFlow.Plus.Examples-master/SeleniumWebTest/TestApplication.UiTests/obj/TestResults" --callbackPort 32770 --loggerPort 32771' in '/Users/../Desktop/../projects/specflow/SpecFlow.Plus.Examples-master/SeleniumWebTest/TestApplication.UiTests/bin/Debug/netcoreapp3.0'
2020-04-29T13:55:54.6057600-04:00:System.ComponentModel.Win32Exception (2): No such file or directory
at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at TechTalk.SpecRun.Framework.Execution.OutOfProc.OutProcExecutorManager.StartProcess(ExecutorProcessInfo executorProcessInfo)
at TechTalk.SpecRun.VisualStudio.TestAdapter.VsOutProcExecutorManager.StartProcess(ExecutorProcessInfo executorProcessInfo)
at TechTalk.SpecRun.Framework.Execution.OutOfProc.StreamJsonRPC.OutOfProcessTestAssemblyExecutorHost.Initialize(Int32 threadId, ITestExecutionManager executionManager, IAssemblyReference testAssembly, ITestLogger currentLogger, String testAssemblyFullPath, String testAssemblyConfigFilePath, TestExecutionConfiguration testExecutionConfiguration, String target)

I'm no expert, not yet;) but I got this error too. and I found that it happened because a Class variable I declared in the Test - in its constructor there was a call to a method of an object stored in a field of the class with I/O from the Console.
when I removed the call from the constructor the tests (unit test) could run ok again.

Related

Unable to load shared library 'python37' or one of its dependencies

I am quite new to dotnet and Keras.NET, and I was trying to set it up on a goorm.io container. After installing the prerequisites (adding $HOME/.keras/keras.json for Tensorflow backend and pip install numpy), and then adding Keras.NET, I tried to run the XOR sample code, but ran into an error.
Unhandled exception. System.DllNotFoundException: Unable to load shared library 'python37' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libpython37: cannot open shared object file: No such file or directory
at Python.Runtime.Runtime.Py_IsInitialized()
at Python.Runtime.Runtime.Initialize(Boolean initSigs)
at Python.Runtime.PythonEngine.Initialize(IEnumerable1 args, Boolean setSysArgv, Boolean initSigs) at Python.Runtime.PythonEngine.Initialize(Boolean setSysArgv, Boolean initSigs) at Python.Runtime.PythonEngine.Initialize() at Numpy.np.InstallAndImport(Boolean force) at Numpy.np.<>c.<.cctor>b__599_0() at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy1.CreateValue()
at System.Lazy1.get_Value() at Numpy.np.get_self() at Numpy.np.get_float32() at Numpy.DtypeExtensions.GetDtype(Object obj) at Numpy.np.array[T](T[,] object, Dtype dtype, Nullable1 copy, String order, Nullable1 subok, Nullable1 ndmin)
at Proj.Program.Main(String[] args) in /workspace/XOR/Proj/Program.cs:line 14
I do not know how to share with the python37 directory. If someone could direct me in the right direction, it would be much appreciated. By the way, I am using Linux if that helps.
Thanks

Apache Spark + Mobius Debug mode

I am new to Apache spark and trying to run this on Windows machine with Mobius.
but i am getting exception while running it.
first of all i have setup following environment variables
JAVA_HOME C:\Program Files\Java\jdk1.8.0_152
HADOOP_HOME C:\winutils
SPARK_HOME c:\spark [spark-2.0.2-bin-hadoop2.6]
SPARKCLR_HOME E:\SparkClr\spark-clr_2.11-2.0.200\runtime
In code provided correct file to read data from as file:///E:/Mobius/Mobius/SampleText.txt
I tried to run it in debug mode
E:\SparkClr\spark-clr_2.11-2.0.200\runtime\scripts>sparkclr-submit.cmd debug
[sparkclr-submit.cmd] SPARKCLR_JAR=spark-clr_2.11-2.0.200.jar
[sparkclr-submit.cmd] LAUNCH_CLASSPATH="E:\SparkClr\spark-clr_2.11-2.0.200\runtime\lib\spark-clr_2.11-2.0.200.jar;c:\spark\jars\*"
Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties
17/12/19 11:34:23 INFO CSharpRunner: Starting CSharpBackend!
17/12/19 11:34:25 INFO CSharpRunner: Port number used by CSharpBackend is 5567
***********************************************************************
* [CSharpRunner.main] Backend running debug mode. Press enter to exit *
***********************************************************************
17/12/19 11:35:09 INFO SparkContext: Running Spark version 2.0.2
In my App.config Added following Entry [Port name with i got from above]
<add key="CSharpBackendPortNumber" value="5567"/>
I am getting below Exception message
JVM method execution failed: Nonstatic method partitions failed for class 12 when called with no parameters
Stack Trace
at Microsoft.Spark.CSharp.Interop.Ipc.JvmBridge.CallJavaMethod(Boolean isStatic, Object classNameOrJvmObjectReference, String methodName, Object[] parameters)
at Microsoft.Spark.CSharp.Interop.Ipc.JvmBridge.CallNonStaticJavaMethod(JvmObjectReference objectId, String methodName)
at Microsoft.Spark.CSharp.Proxy.Ipc.RDDIpcProxy.GetNumPartitions()
at Microsoft.Spark.CSharp.Core.RDD`1.GetDefaultPartitionNum()
at Microsoft.Spark.CSharp.Core.PairRDDFunctions.PartitionBy[K,V](RDD`1 self, Int32 numPartitions, Func`2 partitionFunc)
at Microsoft.Spark.CSharp.Core.PairRDDFunctions.ReduceByKey[K,V](RDD`1 self, Func`3 reduceFunc, Int32 numPartitions)
at Microsoft.Spark.CSharp.Examples.WordCountExample.Main(String[] args) in E:\Mobius\Mobius\examples\Batch\WordCount\Program.cs:line 35
I am not sure about CSharpWorkerPath.
Please help if anyone face this kind of issue earlier.

iis console application directoryentry searchresult

Running a Console Application as a CGI in IIS on Windows 2012 R2.
On connection to Active Directory (AD), using DirectoryEntry, ref:
lccDEDirectoryEntry = new DirectoryEntry(lccSDomainConnectionString, lccSUserId, lccSUserPassword, lccATAuthTypes);
Then using DirectorySearcher, ref:
lccDSSearcher = new DirectorySearcher(lccDEDirectoryEntry);
Then finding all matching objects, ref:
lccSRCResults = lccDSSearcher.FindAll();
Then finally accessing the search results, ref:
foreach (SearchResult lccSRResultLoop in lccSRCResults)
All works fine, until I try to access the Search Results, it throws an "Illegal Characters In Path".
I can run the same Console Application directly on the server hosting the IIS in a command window and it works fine, including accessing/displaying the SearchResults. Also works fine on Windows 7 workstation/etc.
I hit this same type issue a year ago with a call to HttpUtility, and it ended up being a bug in IIS where it is looking for a configuration setting that is null. Microsoft supplied a fix to use this line:
AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", Environment.CurrentDirectory + "\" + System.AppDomain.CurrentDomain.FriendlyName + ".config");
Per this blog page:
http://www.dreamincode.net/forums/topic/300197-webrequest-in-a-cgi
And that solved the null configuration setting a year ago, as when you run HttpUtility, IIS looks for an "APP_CONFIG_FILE" setting that is not set when running as a Console Application and isn't used.
Well, my debugging/etc. has shown that the same issue being hit, i.e. a setting is null and so the function "CheckIllegalCharacters" isn't crashing as it can't parse a null value.
Unfortunately, I cannot locate the setting it is looking for. I even enumerated through all AppSetting keys, ref:
https://msdn.microsoft.com/en-us/library/system.appdomain.getdata%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396
And have my code filling each one in with a dummy value, but, no go.
Any clue on how to find the missing setting key name? Or other solution?
Here is the Stack Trace. At the bottom is my function 'lccLDAP', which initiates the rest by calling the SearchResults loop.
STACK TRACE
at System.Security.Permissions.FileIOPermission.CheckIllegalCharacters(String[] str, Boolean onlyCheckExtras)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String path)
at System.Reflection.RuntimeModule.get_FullyQualifiedName()
at System.Configuration.ClientConfigPaths.SetNamesAndVersion(String applicationFilename, Assembly exeAssembly, Boolean isHttp)
at System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean includeUserConfig)
at System.Configuration.ClientConfigPaths.GetPaths(String exePath, Boolean includeUserConfig)
at System.Configuration.ClientConfigurationHost.RequireCompleteInit(IInternalConfigRecord record)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)
at System.DirectoryServices.SearchResultCollection.ResultsEnumerator..ctor(SearchResultCollection results, String parentUserName, String parentPassword, AuthenticationTypes parentAuthenticationType)
at System.DirectoryServices.SearchResultCollection.get_InnerList()
at System.DirectoryServices.SearchResultCollection.get_Item(Int32 index)
at lccCoreFunctionsClass.lccLDAP(lccSettingsClass lccParamSCSettings, Int32 lccLDAPId, Int32 lccIFlag, String lccSParam)
Adding what I finally did. Since my console app runs fine on the IIS server, just not through IIS for Directory.SearchResults, I split the program to run in front-end and back-end modes. The front-end servers IIS web pages, and passes requests to the back-end for LDAP tasks. The back-end then serves responses to the front-end. Good tier-3 security anyway. Just in case others look for a possible solution.

Unmanaged Exports Error when Building Assembly with FinalBuilder

I have done an Assembly with exported methods using R. Gieseckes UnmanagedExports dll. Building this assembly within VS 2012 works great. But building the assembly as part of
a larger solution with FinalBuilder throws the following error:
Parse IL: Parsing 1517 lines of IL took 120 ms.
C:\BuildSource\branches\Standard\Projects\Intf_New\Interfaces\StdInterface\packages\UnmanagedExports.1.2.4.23262\tools\RGiesecke.DllExport.targets(42,5): error : Der Index, basierend auf 0 (null), muss größer als oder gleich Null sein, und kleiner als die Größe der Argumentenliste.
bei System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
bei System.String.Format(IFormatProvider provider, String format, Object[] args)
bei RGiesecke.DllExport.DllExportNotifier.Notify(Int32 severity, String code, String fileName, Nullable1 startPosition, Nullable1 endPosition, String message, Object[] values) in d:\Work\Libraries\RGiesecke.DllExport\RGiesecke.DllExport\DllExportNotifier.cs:Zeile 135.
bei RGiesecke.DllExport.DllExportNotifier.Notify(Int32 severity, String code, String message, Object[] values) in d:\Work\Libraries\RGiesecke.DllExport\RGiesecke.DllExport\DllExportNotifier.cs:Zeile 119.
bei RGiesecke.DllExport.Parsing.IlAsm.RunLibTool(CpuPlatform cpu, String fileName, String directory) in d:\Work\Libraries\RGiesecke.DllExport\RGiesecke.DllExport\Parsing\ILAsm.cs:Zeile 212.
bei RGiesecke.DllExport.Parsing.IlAsm.RunCore(CpuPlatform cpu, String fileName, String ressourceParam, String ilSuffix) in d:\Work\Libraries\RGiesecke.DllExport\RGiesecke.DllExport\Parsing\ILAsm.cs:Zeile 186.
bei RGiesecke.DllExport.Parsing.IlAsm.Run(String outputFile, String ilSuffix, CpuPlatform cpu) in d:\Work\Libraries\RGiesecke.DllExport\RGiesecke.DllExport\Parsing\ILAsm.cs:Zeile 123.
bei RGiesecke.DllExport.Parsing.IlAsm.ReassembleFile(String outputFile, String ilSuffix, CpuPlatform cpu) in d:\Work\Libraries\RGiesecke.DllExport\RGiesecke.DllExport\Parsing\ILAsm.cs:Zeile 75.
bei RGiesecke.DllExport.DllExportWeaver.RunIlAsm(IlAsm ilAsm) in d:\Work\Libraries\RGiesecke.DllExport\RGiesecke.DllExport\DllExportWeaver.cs:Zeile 151.
bei RGiesecke.DllExport.DllExportWeaver.Run() in d:\Work\Libraries\RGiesecke.DllExport\RGiesecke.DllExport\DllExportWeaver.cs:Zeile 81.
bei RGiesecke.DllExport.MSBuild.ExportTaskImplementation`1.Execute() in d:\Work\Libraries\RGiesecke.DllExport\RGiesecke.DllExport.MSBuild\ExportTaskImplementation.cs:Zeile 243.
Anyone having seen this before? Any hints?
Regards
All I can think is the nugget package that's collecting the component is not loaded has been updated in the project reference or that there is CPU architecture x86/x64 complication.
Looks like you have a combination of d:\Work\Libraries\ and C:\BuildSource\branches\ directories and you might have unexpected links in your project file that are hard coded to different directories rather than using relative references. Have a look at the *.*proj files and hint paths.
Some times I open the VS Solution in the build directory and check for compile issues.
Make sure you use a clean build directory each time. Try running Finalbuilder on a non dev machine to see how well you can build it. I found I had lots of implicit links, so I had to upgrade my Repository to include them or use Nugget actions prior to building the solution.

MSB0001: Internal MSBuild Error: refCount should not be less than 1

Does anyone know what this means? I am getting this error in my CI build (CruiseControl.Net + NAnt + MSBuild), locally this project compiles just fine...
My.Web.csproj: Error MSB4014: The build was aborted because of an internal failure.
Microsoft.Build.Shared.InternalErrorException: MSB0001: Internal MSBuild Error: refCount should not be less than 1.
at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Exception innerException, Object[] args)
at Microsoft.Build.Collections.CopyOnWriteDictionary\`2.CopyOnWriteBackingDictionary\`2.get_HasNoClones()
at Microsoft.Build.Collections.CopyOnWriteDictionary\`2.set_Item(K key, V value)
at Microsoft.Build.Collections.CopyOnWriteDictionary`2.System.Collections.IDictionary.set_Item(Object key, Object value)
at Microsoft.Build.BuildEngine.BuildItem..ctor(String itemName, ITaskItem taskItem)
at Microsoft.Build.BuildEngine.TaskEngine.GatherTaskItemOutputs(Lookup lookup, TaskOutput taskOutputSpecification, String itemName, String propertyName, Object outputs)
at Microsoft.Build.BuildEngine.TaskEngine.GatherGeneratedTaskOutputs(Lookup lookup, TaskOutput taskOutputSpecification, String taskParameterName, String itemName, String propertyName, ITask task)
at Microsoft.Build.BuildEngine.TaskEngine.GatherTaskOutputs(TaskExecutionMode howToExecuteTask, ITask task, ItemBucket bucket)
at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)
at Microsoft.Build.BuildEngine.TaskEngine.ExecuteBucket(EngineProxy engineProxy, ItemBucket bucket, Int32 bucketNumber, TaskExecutionMode howToExecuteTask)
at Microsoft.Build.BuildEngine.TaskEngine.ExecuteTask(TaskExecutionMode howToExecuteTask, Lookup lookup)
at Microsoft.Build.BuildEngine.TaskExecutionState.TaskEngineExecuteTask(TaskEngine taskEngine, TaskExecutionMode howTaskShouldBeExecuted, Lookup lookup)
at Microsoft.Build.BuildEngine.TaskExecutionState.ExecuteTask()
at Microsoft.Build.BuildEngine.TaskExecutionModule.ExecuteTask(TaskExecutionState taskState)
at Microsoft.Build.BuildEngine.TargetExecutionWrapper.SubmitNonIntrinsicTask(XmlElement taskNode, ITaskHost hostObject, ProjectBuildState buildContext)
at Microsoft.Build.BuildEngine.TargetExecutionWrapper.ExecuteCurrentTask(ProjectBuildState buildContext)
at Microsoft.Build.BuildEngine.TargetExecutionWrapper.ContinueRunningTasks(ProjectBuildState buildContext, TaskExecutionContext taskExecutionContext, Boolean startingFirstTask)
at Microsoft.Build.BuildEngine.TargetExecutionWrapper.ContinueBuild(ProjectBuildState buildContext, TaskExecutionContext taskExecutionContext)
at Microsoft.Build.BuildEngine.Project.ExecuteNextActionForProjectContext(ProjectBuildState buildContext, Boolean initialCall)
at Microsoft.Build.BuildEngine.Project.CalculateNextActionForProjectContext(ProjectBuildState buildContext)
at Microsoft.Build.BuildEngine.Project.ContinueBuild(ProjectBuildState buildContext, TaskExecutionContext taskExecutionContext)
at Microsoft.Build.BuildEngine.Project.BuildInternal(BuildRequest buildRequest)
at Microsoft.Build.BuildEngine.Engine.BuildProjectInternalInitial(BuildRequest buildRequest, Project project)
at Microsoft.Build.BuildEngine.Engine.BuildProjectInternal(BuildRequest buildRequest, ProjectBuildState buildContext, TaskExecutionContext taskExecutionContext, Boolean initialCall)
at Microsoft.Build.BuildEngine.Engine.EngineBuildLoop(BuildRequest terminatingBuildRequest)
at Microsoft.Build.BuildEngine.Engine.PostProjectEvaluationRequests(Project project, String[] projectFiles, String[][] targetNames, BuildPropertyGroup[] globalPropertiesPerProject, IDictionary[] targetOutputsPerProject, BuildSettings buildFlags, String[] toolVersions)
Unexpected error while compiling project 'My.Web'
Exception has been thrown by the target of an invocation.
MSB0001: Internal MSBuild Error: refCount should not be less than 1.
I ran into the same problem in a similar environment. In my case, the project had a COM reference to the Active DS Type Library, which wasn't installed on the build server.
To fix the problem, I dropped the COM reference and added a reference to an interop assembly, which was then deployed to the build server.
Found the solution: instead of using <solution> in the build target I called msbuild directly with <exec>. Everything works now.
My problem it's similar with you, I'm have to eliminate two projects that relationship with my solution in mobil enviroment, that cause the conflict with the others projects in my solution.
My other projects are desktop, mvc, webapi enviroment.
I have to create a new solution for my others mobil projects

Categories

Resources