Scripts fail with error that Microsoft.ServiceFabric.Internal.Strings.dll is unavailable when "Microsoft Service Fabric" is installed - azure-service-fabric

After upgrading to the latest tools, runtime and SDK (5.5.216.0), PowerShell scripts, such as TestConfiguration.ps1, fail with an error that Microsoft.ServiceFabric.Internal.Strings.dll version 5.0.0.0 can't be found. As soon as I deinstall 'Microsoft Service Fabric' from the control panel, it works just fine. This behavior seems very similar to the Newtonsoft.Json.dll issue that was resolved in 5.5.216.0, just with a different assembly this time around.
Is this a known issue?
It quickly gets tedious to have to uninstall 'Microsoft Service Fabric' when I run certain scripts and then have to install it again for others that require it.
Example of error:
PS C:\git\sf-admin\DeploymentScripts\Microsoft.Azure.ServiceFabric.WindowsServer> .\TestConfiguration.ps1 ..\ClusterConfig.Production.Shared.json
Trace folder doesn't exist. Creating trace folder: C:\git\sf-admin\DeploymentScripts\Microsoft.Azure.ServiceFabric.WindowsServer\DeploymentTraces
Running Best Practices Analyzer...
Standalone package dependent files not found. Check package structure. Error: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.ServiceFabric.Internal.Strings, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or on
e of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.ServiceFabric.Internal.Strings, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
at Microsoft.ServiceFabric.ClusterManagementCommon.ValidatorExtensions.ThrowValidationExceptionIfNull[T](T parameter, String parameterName)
at Microsoft.ServiceFabric.DeploymentManager.BPA.BestPracticesAnalyzer.IsJsonConfigModelValid(StandAloneInstallerJsonModelBase config)
Thanks,
Hans

I believe you're getting that error due to the SDK/Runtime installing dll's to the GAC which are being picked up.
Try running moving your Microsoft.Azure.ServiceFabric.WindowsServer folder to another machine and running TestConfiguration.ps1 again.
If you're running the scripts from a box without internet access then you'll need to specify the location of the .cab which contains the runtime
-FabricRuntimePackagePath C:\temp\Microsoft.Azure.ServiceFabric.WindowsServer.5.5.216.0\MicrosoftAzureServiceFabric5.5.216.0.cab

Related

Firebase Database in Unity with REST API

I am trying to create a connection to the Firebase Realtime Database by following this tutorial: https://medium.com/#rotolonico/firebase-database-in-unity-with-rest-api-42f2cf6a2bbf to understand how it works and modify as I go. However, I am getting the following errors (these are just some of the errors):
Assembly DLL name is reserved for internal use: Assets/UnityEngine.dll (did files generated by a build accidentally end up in your Assets/ folder?)
C:\Program files\2019.4.20f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\UI\Core\FontData.cs(135,16): error CS0433: The type 'TextAnchor' exists in both 'UnityEngine.TextRenderingModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'`
C:\Program Files\2019.4.20f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\UI\Core\InputField.cs(241,10): error CS0433: The type 'SerializeField' exists in both 'UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
These errors are populating when I did the following steps:
Navigate to the Build Files (DLL) folder.
Open CommonData.csproj in your favorite text editor.
Change the UnityInstallFolder value on line 6 to point to your Unity installation directory
On OSX this is likely /Applications/Unity/Editor
On Windows this is likely C:\Program Files (x86)\Unity\Editor
Double click FullSerializer.sln to open up the solution
Run a build-all (F6 in visual studio). Alternatively, you can right-click any of the three projects to build only one of them.
FullSerializer - NoUnity builds Full Serializer so that you can use it outside of Unity.
FullSerializer - Unity builds Full Serializer to a DLL
FullSerializer - Unity - WinRT builds Full Serializer with WinRT APIs (if you're targeting the Windows Store or the Windows Phone export platforms)
You will find the DLLs inside of the Build folder. Please add them to your Unity project's Asset folder.
Here is the path where unity is installed:
C:\Program Files\2019.4.20f1\Editor
I opened the FullSerializer.sln, and build one of the three projects, and so on.
I am not sure what I am doing wrong. Any help would be appreciated.
I was able to determine the issue. It appears that although the instruction suggests adding the source folder in the assets folder of the Unity Project, I remove it from there and put it in the same level as the assets folder. That resolved the issue. Hope this helps anyone else who has encountered this issue.

Running migrate.exe from powershell for Cloud Services Project?

I'm trying to write a powershell script that runs migrations for a cloud service project:
$migrator = "C:\Path\EntityFramework.6.1.3\tools\migrate.exe"
$migrateCommand = "$migrator file.dll /StartUpDirectory=C:\path\bin\Test /connectionStringName:myconnection /startUpConfigurationFile:C:\path\app.config /verbose"
Invoke-Expression $migrateCommand
And I keep getting the following error when I run the script: "Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified."
I have copied migrate.exe to my bin folder where all the dll's are and I'm using absolute path's for the startupdirectory and configuration file. Can't seem to figure out what I'm missing? Also another question I had was could migrate.exe be only used with webrole/workerrole projects?
The problem is migrator was searching entityframework.dll in the same working directory. You could change the working directory to the folder which contains your entityframework.dll

Assembly version conflicts for AutoFixture and Moq with NUnit on TeamCity 7

I previously had all unit tests for my solution contained in a single library, and were recently split out. When located in a single assembly, all tests passed both locally and on TeamCity, but when seperated there are version conflicts.
Config:
Team City 7.1.5 (build 24400)
AutoFixture 3.20.2
AutoFixture.AutoMoq 3.20.2
Moq 4.2.1402.2112
NUnit 2.6.3
I have several unit test assemblies, which all reference a base test library. All test assemblies use the NuGet packages listed above.
When running tests on a dev machine (VS 2015), all tests pass successfully.
When running a team city build, the following error is thrown:
System.IO.FileLoadException : Could not load file or assembly 'Moq, Version=4.1.1308.2120, Culture=neutral, PublicKeyToken=69f491c39445e920' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) at Ploeh.AutoFixture.AutoMoq.MockPostprocessor.Create(Object request, ISpecimenContext context)
There is no reference to Moq 4.1.1308.2120 anywhere in my solution, so I know it must be a reference from AutoFixture.
Updating AutoFixture to 3.31.3 makes no difference.
I have the following Binding Redirect in the app.config files of all test assemblies:
<dependentAssembly>
<assemblyIdentity name="Moq" publicKeyToken="69f491c39445e920" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.1402.2112" newVersion="4.2.1402.2112" />
</dependentAssembly>
I cannot downgrade my version of Moq to 4.1.1308.2120 as I use features of 4.2 in my tests.
It appears to me that Team City is ignoring the redirects. I have no idea why, and having tried every combination of version for these assemblies I cannot get Team City to run the tests successfully.
We ran into this problem as well. We ran the assembly Fusion Logs on our build server and saw this in the error logs:
Calling assembly : Ploeh.AutoFixture.AutoMoq, Version=3.50.2.0, Culture=neutral, PublicKeyToken=b24654c590009d4f.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Moq, Version=4.1.1308.2120, Culture=neutral, PublicKeyToken=69f491c39445e920
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///D:/builds/13/s/AssessmentMigratorService.IntegrationPostbuild/bin/Debug/Moq.DLL.
LOG: Assembly download was successful. Attempting setup of file: D:\builds\13\s\AssessmentMigratorService.IntegrationPostbuild\bin\Debug\Moq.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Moq, Version=4.5.28.0, Culture=neutral, PublicKeyToken=69f491c39445e920
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: The assembly reference did not match the assembly definition found.
ERR: Run-from-source setup phase failed with hr = 0x80131040.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated
So if you see this part of it
No application configuration file found.
what I think is happening is that the unit test runner host application on the build server is not seeing the application configuration file and so the assembly binding redirects are not able to apply, since they are in the app.config.
So I see 3 possible solutions/workarounds if you need to use these assemblies:
Figure out why TeamCity's unit test runner on the build server cannot find the application configuration file and fix that.
Use a different unit test runner on the build server.
Add the binding redirects to the machine.config of the build server. That will apply globally on the entire machine, so there is no need for the redirects in the application configuration file at that point.
I was embarrassed when I discovered the reason that I was seeing this error.
After 8 hours debugging I found that I had referenced TestProjectB in TestProjectA. Teamcity was set up to run any xunit against any Test*.dll that it found. So it found the TestProjectB.dll in TestProjectA's /bin/Debug folder.
But there is no TestProjectB.dll.config for TestProjectB.dll when it is in /TestProjectA/bin/Debug. Hence none of the assembly binding/redirect where being set.
I remove the project reference because it was unnecessary and updated my teamcity xunit runner to exclude dlls that don't have a matching config.

"Could not load file or assembly 'TypeMock.Interceptors, Version=0.0.0.0"

We have just upgraded Typemock from 6.0.2.0 to Typemock 7.3.0.0. And we now get the following error at runtime:
[System.IO.FileNotFoundException] = {"Could not load file or assembly 'TypeMock.Interceptors, Version=0.0.0.0, Culture=neutral, PublicKeyToken=0000000000000000' or one of its dependencies. The system cannot find the file specified.":"TypeMock.Interceptors, Version=0.0.0.0, Culture=neutral, Pu...
During debugging I can see that the source throwing it is mscorlib. The mystifying thing is that I have unloaded all of my projects that have references to Typemock.dlls but still get this error. When I choose "suspend mocking" in the Typemock-menu everything works.
In the GAC I can see that Typemock.Interceptors 7.3.0.0 is installed.
Any ideas?
I called TypeMock support, and they confirmed that it was a bug in TypeMock. They sent me a newer version (7.3.2.0) and the issue has now disappeared.

How to copy/install assembly in a GAC? (Some problem running NUnit)

I have NUnit installed at this directory.
C:\Program Files\NUnit 2.5.5\bin\net-2.0
I made the directory beneath a GAC.
C:\Windows\Microsoft.NET\assembly\GAC_MSIL\NUnit
and copied the nunit.framework.dll, but I got the same error.
When I try to run my unit test (mut.dll) in some random directory. I get the following error. I have to copy the mut.dll under the NUnit directory in order to run it.
ProcessModel: Default DomainUsage: Single
Execution Runtime: net-2.0
Could not load file or assembly 'nunit.framework, Version=2.5.5.10112, Culture=n
eutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies. The system
cannot find the file specified.
What went wrong? How can I install/copy the assembly inside a GAC?
You could add the NUnit directory to your PATH environment variable, that might take care of it.
Otherwise, check out this stack overflow post for other ideas.