When perfoming a Release build for our UWP project the following error occurs:
System.InvalidOperationException: Unable to generate a temporary class Result=1).
And a second issue:
error CS1703: An assembly with the same identity 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' has already been imported. Try removing one of the duplicate references.
I tried to reproduce the issue with a new solution but I cannot figure out the dependencies responsible for those issues.
Related
Im running an Azure Function .NET Standard 2.0 and get following error:
An exception of type 'System.IO.FileLoadException' occurred in Function.dll but was not handled in user code
Could not load file or assembly 'Microsoft.WindowsAzure.Storage, Version=9.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
The assembly file exist in the bin/debug folder. Been reading some threads about this but without a solution (https://github.com/Azure/azure-functions-core-tools/issues/322#issuecomment-352233979), anyone know what to do?
I'm using code from another .NET Standard 2.0 project but all my projects have a reference to Microsoft.WindowsAzure.Storage 9.2.0.0 and that nuget package installed.
Thanks!
You can add reference below to downgrade your storage reference explicitly.
<PackageReference Include="WindowsAzure.Storage" Version="8.6.0" />
See this issue comment.
This restriction (like many of the other assembly version restrictions we had with other extensions) is a temporary issue and will be addressed in upcoming preview releases.
This issue has been fixed in latest host 2.0.11888, but built cli(tools to run functions) is not available yet.
Update
2.0.11888 has been available to VS users.
I'm running a .NET Standard 2.0 Azure function which references another .NET Standard 2.0 class library.
I'm able to build the function which references the class library. But when I run a specific function which uses the class library I get an exception.
Exception during runtime resolution of assembly 'StorageQueueStandard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null': 'System.InvalidCastException: [A]System.AppDomain cannot be cast to [B]System.AppDomain. Type A originates from 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' in the context 'Default' at location 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.0.5\System.Private.CoreLib.dll'. Type B originates from 'System.Runtime.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' in the context 'Default' at location 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.0.5\System.Runtime.Extensions.dll'.
[21-2-2018 08:48:47] at Microsoft.Azure.WebJobs.Script.Description.FunctionAssemblyLoader.ResolveAssembly(Object sender, ResolveEventArgs args) in C:\azure-webjobs-sdk-script\src\WebJobs.Script\Description\DotNet\FunctionAssemblyLoader.cs:line 69'
[21-2-2018 08:48:47] Unable to find assembly 'StorageQueueStandard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Are you missing a private assembly file?
"StorageQueueStandard" is the name of the class library.
[A]System.AppDomain cannot be cast to [B]System.AppDomain.
This can happen when the assembly is loaded from different dlls.
As the error shows, both of System.Private.CoreLib and System.Runtime.Extensions have System.AppDomain.
Please check your code and check refer to this issue. The issue shows that the new .NET Core doesn't yet support ServiceBus trigger during runtime.
I am not clear where you have this error, so if you still have this problem, hope you could show me more detailed code and description.
To fix my problem I deleted my project and created a new azure .net standard function with Visual Studio.
After that I downgraded WindowsAzure.Storage to 8.6.0.
For more information visit: https://github.com/Azure/azure-functions-core-tools/issues/322
Is it possible to use ServiceStack OrmLite on a Xamarin android project? I'm having a hard time finding the right combination of dlls. I've tried building from ServiceStack.OrmLite.Android.sln and using the resulting dlls, but when I add ServiceStack.OrmLite.Sqlite.Android.dll to the solution I get the following error when I build:
Error 2 Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'System.Data.Linq.dll'
at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(List`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(List`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
at Xamarin.Android.Tasks.ResolveAssemblies.Execute() C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets 853 2 AndroidApplication1
I have seen some post around indicating they were able to use Ormlite with a Xamarin android project, but they don't have any details on the implementation and they are old enough that they probably used v3 of ServiceStack.
I'm using the starter edition of ServiceStack, although i don't think that would have any impact.
Thanks,
Estyn
Either build the V3 branch source code or get the DLL's from here:
https://github.com/sami1971/SimplyMobile/tree/master/libs/ServiceStack
You can also fork this branch of ServiceStack.OrmLite if nothing else works, it's where I first published OrmLite Android & iOS support: https://github.com/sami1971/ServiceStack.OrmLite-1
When I build for the iPhone simulator all seems to work fine. However, when I build for the iPhone, I get messages saying the following -
Warning MT3005: The dependency 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' of the assembly 'Cirrious.CrossCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e16445fd9b451819' was not found. Please review the project's references. (MT3005) (IMI.Webstore.Mobile)
This worked with previous versions of Xamarin but the current beta release seems to have broken something. Any ideas?
After reviewing the build log further, it actually wasn't a problem with finding that particular dll, even though there were warnings about it.
The issue was actually with some directory permissions due to a some what complicated windows VM setup. I ended up cloning a copy of the code base into a different directory and the issue sorted itself out. PHEW!
You need to reference System.Windows in your Touch Project.
I currently have a VS2012 solution with a WP71 project and a WP8 project. Each of these projects reference a Portable Class Library project where I keep the view models. I also have a Unit Test project that references the PCL and contains tests for the view models.
The problem I'm having is when I compile the unit test project I get the following error:
error CS0012: The type 'System.Windows.Input.ICommand' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes'
All of the projects, including the unit test project, reference the Portable.MvvmLightLibs NuGet package.
After looking around for this assembly I noticed that there are different versions, one for WP8, one for Silverlight 4, etc. Out of all these versions I'm not sure which to use.
The unit test project is targeting .NET Framework 4.5, so I added the System.Windows assembly for that version which works, but I then get the following error:
error : CA0001 : Could not resolve reference to System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes
Seeing as this is a code analysis error I'm tempted to simply ignore this and carry on, but I was wondering if anyone had any ideas on how to solve this or whether it is safe to ignore it?
So, I figured a way to solve the problem.
To get the test project to compile I had to add the System.Windows.dll assembly from:
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71
But, adding it using the Add Reference dialog automatically adds the .NET 4.5 version even if I browsed directly to the folder. To fix this I opened the *.csproj for the test project and replaced the line:
<Reference Include="System.Windows"/>
with
<Reference Include="System.Windows">
<HintPath>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\System.Windows.dll</HintPath>
</Reference>
This ensured that the 2.0.5.0 version was referenced instead of the .NET 4.5 version. The problem with this approach is certain types conflict with other assemblies, namely the System.dll, but seeing as I'm only testing view models from a Portable Class Library, I'm not all that bothered.
Ideally the test project would also be a Portable Class Library, but I've not got round to testing that.
One other issue was I tend to have warnings show up as errors when building in release mode, so this always fails because there will always be a warning complaining about naming clashes with System.dll.