SMDiagnostics not resolved - xamarin.android

I have an old Xamarin project which compiled OK a year or so ago, in VS2017.
Today I tried recompiling, but I am getting this error:
Can not resolve reference: SMDiagnostics, referenced by Mono.Android > System.Runtime.Serialization. Please add a NuGet package or assembly reference for SMDiagnostics, or remove the reference to Mono.Android
AFAIK I haven't changed anything in my project, although of course Windows10 will have been updated.
There are several options for Mono.android in the reference manager:
I have tried removing the ref and re-installing a couple of them, with no improvement.
Furthwermore, I have searched for 'SMDiagnsotics' in the project and found no mention of it anywhere.

Now aded a new reference to SMDiagnostics; that issue resolved but moved on to a new error. Strange though how unchanged project source can result in multiple errors after a short break of not maintaining it.

Related

vs2019 'SharpDX.Toolkit.Compiler' could not be found after Nuget package update

I have an old WPF/HelixToolkit/SharpDX project from 2016 that I started working with. I was having some viewport issues and thought they might be cured by updating HelixToolkit & SharpDX packages. Unfortunately, after the updates my project will no longer compile.
I tried Build->Clean and Rebuild All, but no joy. Still getting these errors:
Severity Code Description Project File Line Suppression State
Error The "SharpDX.Toolkit.EffectCompilerTask" task could not be loaded from the assembly \SharpDX.Toolkit.CompilerTask.dll. Could not load file or assembly 'file:///C:\SharpDX.Toolkit.CompilerTask.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. MyWPFMagViewer2
Severity Code Description Project File Line Suppression State
Warning The referenced component 'SharpDX.Toolkit.Compiler' could not be found. MyWPFMagViewer2
I'm really hoping it's something simple, but I don't have a clue what it might be. Can anyone help?
TIA,
Frank
I never found an answer to this problem, but I was able to work around it by re-cloning my project from GitHub, and not updating SharpDX
Frank

Not being able to build F# type provider SDK

I have finally come across something that no one else seemed to have come across (at least from what I can tell). I trying to build an F# type provider using TypeProviders.SDK.
As soon as I build the solution I get the error: "FS0810, Property 'CultureName' cannot be set, \LemonadeProvider\paket-files\fsprojects\FSharp.TypeProviders.SDK\src\ProvidedTypes.fs" on line 2090 and again at 3162 in the design time project of the solution.
I do not think this is useful but the Test project also fails as it can not find the LemonadeProvider.Runtime.dll. I am assuming this will get created when the Runtime project will build successfully.
PS: As of right now I am just tring to build the provided template, I have not changed the code or added anything to it. Hence I have not attached any code, but please feel free to ask for it.
The corresponding issue is https://github.com/fsprojects/FSharp.TypeProviders.SDK/issues/353
Known workarounds
Change minimum target to net461. Replace all instances of net45 with net461, except for in netfx.props, where you can just delete the lines referencing net45* frameworks (I suspect the removal of those lines isn't strictly speaking necessary).
I did this workaround but am now facing these kinds of errors: (like 2000 of them)
C:\Users\user\source\repos\HelloWorldProvider\paket-files\fsprojects\FSharp.TypeProviders.SDK\src\ProvidedTypes.fs(34,7): error FS0074: The type referenced through 'System.Attribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard'. [C:\Users\user\source\repos\HelloWorldProvider\src\HelloWorldProvider.DesignTime\HelloWorldProvider.DesignTime.fsproj]
I found out that the issue lied with the ProvidedTypes.fs and ProvidedTypes.fsi files created by the SDK.
The issue was solved for me when I replaced the files with the ones found in 'SDK-dsyme-patch-7' which provided compatibility for different .Net environments which was missing from the original SDK. There might be other differences but this is the one I found and it fixed the problem for me.
The files can be found under '/src/' in the dsyme patch.
The code I am referring to is as follows and has been added twice to the ProvidedTypes.fs:
#if NETSTANDARD
asmName.CultureName <- System.Globalization.CultureInfo.InvariantCulture.Name
#else
asmName.CultureInfo <- System.Globalization.CultureInfo.InvariantCulture
#endif
asmName
I am not aware if there is a new SDK that has solved the problem. But at the time when the question was asked, this is what worked for me.

'Resource.Designer.cs' keeps old namespace after it has been changed throughout entire solution

At some point project identity was modified and i reflected that in code by renaming the solution, project, assembly and default namespace, with all corresponding folders - all instances of a name that i could find. I also used Notepad2 to fix the contents of solution and project files.
Note: Namespace in code was changed using VStudio's Rename feature.
Since then every time Resource.Designer.cs file gets re-generated, it pulls the old namespace in (?!), breaking the reference to automatic Resource class, which defines resource IDs:
Obviously, i try to fix this:
And in some cases it will immediately get re-generated again - you guessed it - with the old name, but sometimes(!) it will accept my edit, save it and let the project be actually compiled and run:
I've tried Clean and Rebuild commands multiple times for both project and solution, restarted VStudio, rebooted Windows.. No dice, it keeps happening.
App's TargetPlatform is 7.1, MinimumVersion is 4.3, all 5 supported architectures are enabled. VStudio - 15.5.4, .NET - 4.7.03056, Xamarin - 4.8.0.757, Xamarin.Android SDK - 8.1.3.0.
Just found this in the Similar Questions list:
Ambiguous reference intellisense error from Resource.Designer.cs. Looked promising, so i did the following:
Closed solution in VisualStudio.
Removed entirely \bin and \obj subfolders in File Explorer.
Edited Resource.Designer.cs, so it has correct (new) namespace: J7987ca.
Added 'AndroidUseManagedDesignTimeResourceGenerator' to J7987ca.csproj, as advised.
Opened the solution, and here's the result - old namespace is back:
I guess, i can start with a clean slate and re-create entire solution from scratch with a new name, but for the Love of God, why do i have to do that? And where does it pull the old name from?!
My last image shows <RootNamespace>J7980ca</RootNamespace> - the old name. I did not pay much attention to re-check that tab after re-opening solution, because such an awful glitch would never occure to me: i never had problems saving values in those VS "dialogs" previously.
It turns out that changing Default Namespace in Project Properties does not take effect!
I verified it twice.
Mind you, Assembly Name was saved, so i'm at a loss of wits to explain, how all this is happening.
As soon as i edited .csproj in Notepad2 re-opening the solution happily put proper namespace into Resources.Designer.cs and allowed compilation.
I'm a little late to this, but I ran into this issue recently and was able to fix it by updating both <RootNamespace> and <AssemblyName> tags in the Android csproj file.
Then cleaning the sln and closing Visual Studio and deleting bin, obj, and the old Resource.Designer.cs file (from the directory using the File Explorer and not by removing it from the csproj).
You also need to change it in the assembly line, not just the namespace.
For example
[assembly: global::Android.Runtime.ResourceDesignerAttribute("com.companyname.TestBottomSheetDialog.Resource", IsApplication=true)]
namespace com.companyname.TestBottomSheetDialog

Issue with Unity.Tasks in the ios-firebase unity plugin

I'm trying to upgrade to the latest IOS-Unity plugin and I keep getting this compilation error:
Assets/Scripts/Analytics.cs(38,16): error CS0012: The type
System.Threading.Tasks.Task' is defined in an assembly that is not
referenced. Consider adding a reference to assemblyUnity.Tasks,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
It's worth noting that before this error it complained about a duplicate UnityCompat.dll file (defined in both Firebase/Plugins and Parse/Plugins -- I ended up removing the one in the Parse directory, but I have tried the opposite as well).
Any pointers would be great. Also worth noting that this happened after removing obsolete files from the PlayServices plugin when prompted.
Answering my own question (from https://groups.google.com/forum/#!topic/firebase-talk/2w1Lk62VIcg)
Parse/Plugins/Unity.Tasks needs to the enabled for compilation (using Unity's Inspector)
Parse/Plugins/Unity.Compat needs to be disabled
I had a similar problem and resolved it by following the documentation :
(https://firebase.google.com/docs/unity/setup#set_up_environment)
Assets > Play Services Resolver > Version Handler > Update to enable the correct DLLs for your project.

A problem with Castle.Core.dll

the thing is I have an issue with Castle.Core.dll. I've installed RC3 from their website, so I have 1.0.3.0 version of DLL.
I`m studying MVC framework using Steve Sanderson's book (which is great, btw) and running samples.
Project compiled successfully, all was running, but suprisingly today I've got this runtime exception:
Method not found: 'Void Castle.Core.Configuration.ConfigurationCollection.AddRange(Castle.Core.Configuration.ConfigurationCollection)'
It's strange because before today project was OK, all worked well. I checked on RedGate's Reflector - this method is present in the DLL.
So, any ideas what I've done wrong? I restarted VS, deleted reference and added it again - in vain:(. Googling does nothing for me - many people have similar troubles, but not exactly.
EDIT:
And, by the way, I've tried Steve's code downloaded from apress.com. It didn`t work - the reason is the same.
[UPDATE - pulling what's in comments to the body of the answer]
Ensure you have no old (RC) version installed in your GAC, if you do - uninstall it.
Download binary package of Windsor 2.0 (or newer if available) and unzip it to a folder on your hard drive
Remove old references in your project. Add references to the files you extracted in the above step
Ensure you updated version number in your app.config (can be copied from Reflector)

Resources