guys.
So, the issue is, when I'm trying to make an IL2CPP build, I recieve this:
Building Library\Bee\artifacts\WinPlayerBuildProgram\ManagedStripped failed with output:
C:\Programms\Unity\Editors\2021.2.11f1\Editor\Data\il2cpp\build\deploy\UnityLinker.exe #Library\Bee\artifacts\rsp\16461770786374037127.rsp
Fatal error in Unity CIL Linker
Mono.Linker.LinkerFatalErrorException: ILLink: error IL1005: System.Windows.Forms.XplatUIX11.SetDisplay(IntPtr): Error processing method 'System.Windows.Forms.XplatUIX11.SetDisplay(IntPtr)' in assembly 'System.Windows.Forms.dll'
---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'
at Unity.IL2CPP.Common.MissingMethodStubber.GetTypeModule(TypeReference type, IEnumerable`1 assemblies)
at Unity.Linker.Steps.AddUnresolvedStubsStep.MarkAssemblyOfType(UnityLinkContext context, TypeReference type)
at Unity.Linker.Steps.Marking.UnresolvedStubMarking.HandleUnresolvedType(TypeReference reference)
at Unity.Linker.Steps.UnityMarkStep.HandleUnresolvedType(TypeReference reference)
at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference, DependencyInfo reason, IMemberDefinition sourceLocationMember)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Unity.Linker.Steps.UnityMarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method, DependencyInfo& reason)
at Unity.Linker.Steps.UnityMarkStep.ProcessMethod(MethodDefinition method, DependencyInfo& reason)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
--- End of inner exception stack trace ---
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
at Mono.Linker.Steps.MarkStep.Process()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at Unity.Linker.Steps.UnityMarkStep.Process(LinkContext context)
at Unity.Linker.UnityPipeline.ProcessStep(LinkContext context, IStep step)
at Mono.Linker.Pipeline.Process(LinkContext context)
at Unity.Linker.UnityDriver.UnityRun(Boolean noProfilerAllowed, ILogger customLogger)
at Unity.Linker.UnityDriver.RunDriverWithoutErrorHandling(ILogger customLogger, Boolean noProfilerAllowed)
at Unity.Linker.UnityDriver.RunDriver()
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
I've been searching for an answer to this issue, but the fact it has a conflict with a System folder just kills me.
The Unity version is 2021.2.11f1, Mono build creates just fine.
Could anyone please help?
Please look in your project if you have included System.Windows.Forms.dll in case not please add it.
Also I think that System.Windows.Forms.dll it's not suported by Unity so please search if you have any reference to it and replace it in that case.
I'm almost for sure that is an issue related to references maybe it fixes including all the dlls that are asked.
There is a package called NuGetForUnity that it might help.
Related
I've been using EF Core Power Tools to assist with learning EF Core. The data project is simply a class library that contains the base DbContext used by the associated web app, plus the migrations folder.
It's been working fine until suddenly this error occurs when I "Add DbContext Diagram"
System.InvalidOperationException: Error:
Microsoft.EntityFrameworkCore.Design.OperationException: Unable to create an object of type 'EventFinderContext'. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728
---> System.InvalidOperationException: Unable to resolve service for type 'Microsoft.EntityFrameworkCore.DbContextOptions`1[EventFinderData.EventFinderContext]' while attempting to activate 'EventFinderData.EventFinderContext'.
at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters)
at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.GetServiceOrCreateInstance(IServiceProvider provider, Type type)
at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.<>c__DisplayClass21_4.<FindContextTypes>b__13()
--- End of inner exception stack trace ---
at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.<>c__DisplayClass21_4.<FindContextTypes>b__13()
at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.CreateContext(Func`1 factory)
at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.CreateContext(String contextType)
at Modelling.EfCoreModelBuilder.BuildResult(String outputPath, String startupOutputPath, Boolean generateDdl) in C:\Code\EFCorePowerTools\src\GUI\efpt30.core\EFCoreModelBuilder.cs:line 41
at Modelling.Program.Main(String[] args) in C:\Code\EFCorePowerTools\src\GUI\efpt30.core\Program.cs:line 56
at async Task EFCorePowerTools.Handlers.ModelAnalyzerHandler.GenerateAsync(string outputPath, Project project, GenerationType generationType)
I'm not sure even where to start looking to investigate, so any pointers would be appreciated please. The solution builds okay, the database seems fine, and the associated Blazor project also runs fine.
Not sure if its helpful but in my data project, the constructor for the DbContext is this:
namespace EventFinderData
{
public class EventFinderContext : DbContext
{
public EventFinderContext(DbContextOptions<EventFinderContext> options) : base(options)
{
}
}
}
You have to register EventFinderContext in program.cs
builder.Services.AddDbContext<EventFinderContext>(
opt => opt.UseSqlServer("Your_connection_string"));
As advised by ErikEJ (the author of Power Tools) the diagram function only works on the executable project. Once I had added a web application project to my solution, the original console and data layer projects in that solution no longer worked for creating the diagram.
I'm using netcore 3.1, on macOS Catalina 10.15.6, and JetBrains Rider 2020.2 .
I tried starting a MongoDB connection with the following:
#r "../../../.nuget/packages/dnsclient/1.3.1/lib/net471/DnsClient.dll"
#r "../../../.nuget/packages/mongodb.driver.core/2.11.0/lib/net452/MongoDB.Driver.Core.dll"
#r "../../../.nuget/packages/mongodb.bson/2.11.0/lib/net452/MongoDB.Bson.dll"
#r "../../../.nuget/packages/mongodb.driver/2.11.0/lib/net452/MongoDB.Driver.dll"
let connection = MongoDB.Driver.MongoClient "someConnectionString"
however, when executed, there's still a problem loading the DnsClient assembly, as in the error message below:
System.TypeInitializationException: The type initializer for 'MongoDB.Driver.Core.Misc.DnsClientWrapper' threw an exception.
---> System.IO.FileNotFoundException: Could not load file or assembly 'DnsClient, Version=1.3.1.0, Culture=neutral, PublicKeyToken=4574bb5573c51424'. The system cannot find the file specified.
File name: 'DnsClient, Version=1.3.1.0, Culture=neutral, PublicKeyToken=4574bb5573c51424'
at MongoDB.Driver.Core.Misc.DnsClientWrapper..ctor()
at MongoDB.Driver.Core.Misc.DnsClientWrapper..cctor()
--- End of inner exception stack trace ---
at MongoDB.Driver.Core.Misc.DnsClientWrapper.get_Instance()
at MongoDB.Driver.Core.Configuration.ConnectionString..ctor(String connectionString)
at MongoDB.Driver.MongoUrlBuilder.Parse(String url)
at MongoDB.Driver.MongoUrlBuilder..ctor(String url)
at MongoDB.Driver.MongoUrl..ctor(String url)
at MongoDB.Driver.MongoClientSettings.FromConnectionString(String connectionString)
at MongoDB.Driver.MongoClient..ctor(String connectionString)
at <StartupCode$FSI_0181>.$FSI_0181.main#()
Stopped due to error
How to make the MongoDB.Driver.Core refer to the right path for DnsClient?
Try restore/install all your drivers(mongoDB.Driver.Core and ones depending on),
I got the same error with the following situation :
I have a DAL class library with dependency packages AspNetCore.Identity.MongoDBCore(2.1.1) and MongoDB.Driver.Core(2.11.0), An API project which lacked the Identity.MongoDBCore(2.1.1) but had the MongoDB.Driver.Core(2.11.0),
The Dependency container thrawed the DNSClient exception,{"The type initializer for 'MongoDB.Driver.Core.Misc.DnsClientWrapper' threw an exception."}
I'm trying to add Photon Voice to my Unity app for Windows 10, but I'm getting an error when I try to build the app from Visual Studio.
System.Exception: Exception while processing UnityVoiceFrontend UnityVoiceFrontend PhotonVoiceNetwork::client, error Failed to resolve assembly: 'Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
at Unity.Serialization.Weaver.MethodEmitterBase.WillUnitySerialize(FieldDefinition fieldDefinition)
at Unity.Serialization.Weaver.SerializeMethodEmitterBase.ShouldProcess(FieldDefinition fieldDefinition)
at System.Linq.Enumerable.<>c__DisplayClass6_0`1.<CombinePredicates>b__0(TSource x)
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at Unity.Serialization.Weaver.MethodEmitterBase.EmitMethodBody()
at Unity.Serialization.Weaver.MethodEmitterBase.CreateMethodDef(String methodName)
at Unity.Serialization.Weaver.SerializeMethodEmitter.SerializeMethodDefinitionFor(TypeDefinition typeDef, SerializationBridgeProvider serializationBridgeProvider)
at Unity.Serialization.Weaver.SerializationWeaver.AddSerializeMethod()
at Unity.Serialization.Weaver.SerializationWeaver.Weave()
at usw.Weaver.WeaveAssembly(String assemblyPath, AssemblyDefinition unityEngineAssemblyDefinition, ReaderParameters readerParameters)
at usw.Weaver.Weave()
at usw.Program.RunProgram(ConversionOptions options)
at usw.Program.Main(String[] args)
Am I missing something or did I not do the set up correctly?
I followed the instructions here
nunit-console.exe throws the following error while i tried to execute from Mapped Network Drive
Unhandled Exception: System.TypeInitializationException: The type initializer for 'NUnit.ConsoleRunner.Runner' threw an exception. ---> System.Security.SecurityException: That assembly does not allow partially trusted callers.
at NUnit.ConsoleRunner.Runner..cctor()
The action that failed was:
LinkDemand
The assembly or AppDomain that failed was:
nunit-console-runner, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77
The method that caused the failure was:
NUnit.Core.Logger GetLogger(System.Type)
The Zone of the assembly that failed was:
Internet
The Url of the assembly that failed was:
file:///Z:/jenkinsworkspace/workspace/FlashUpload/tools/NUnit/lib/nunit-console-runner.DLL
--- End of inner exception stack trace ---
at NUnit.ConsoleRunner.Runner.Main(String[] args)
at NUnit.ConsoleRunner.Class1.Main(String[] args)**
I tried adding loadFromRemoteSources enabled="true" in nunit-console.exe.config, but that did not solve the problem.
Add this to the nunit-console.config file.
<supportedRuntime version="v4.0"/>
Got this from here:
Get .NET to consider a specific network share to be fully trusted:
I have been using Entity Framework CTP with Code-First as in this tutorial by Scott Guthrie and another by Scott Hanselman (can't post the link, but google "Simple Code First with Entity Framework 4 - Magic Unicorn Feature CTP 4"). This is working perfectly for the main MVC application, but I am now trying to add a testing project, that uses a separate SQL CE Database.
I have added the following to the App.Config file:
<connectionStrings>
<add name="MyData"
connectionString="Data Source=D:\myProject\myDb.sdf;"
providerName="System.Data.SqlServerCe.4.0" />
</connectionStrings>
However when I try to run the tests it throws the following error when trying to create the database:
Test method
MyProjet.Tests.Administration.ModlelTests.Business.TestGetBusinessesList
threw exception:
System.Reflection.TargetInvocationException:
Exception has been thrown by the
target of an invocation. --->
System.TypeInitializationException:
The type initializer for
'System.Data.SqlServerCe.SqlCeProviderServices'
threw an exception. --->
System.Security.VerificationException:
Operation could destabilize the
runtime.
With the following stack trace:
System.Data.SqlServerCe.SqlCeProviderServices..ctor()
System.Data.SqlServerCe.SqlCeProviderServices..cctor()
System.RuntimeFieldHandle.GetValue(RtFieldInfo
field, Object instance, RuntimeType
fieldType, RuntimeType declaringType,
Boolean& domainInitialized)
System.Reflection.RtFieldInfo.InternalGetValue(Object
obj, Boolean doVisibilityCheck,
Boolean doCheckConsistency)
System.Reflection.RtFieldInfo.InternalGetValue(Object
obj, Boolean doVisibilityCheck)
System.Reflection.RtFieldInfo.GetValue(Object
obj)
System.Data.SqlServerCe.ExtensionMethods.SystemDataSqlServerCeSqlCeProviderServices_Instance_GetValue()
System.Data.SqlServerCe.ExtensionMethods.SystemDataSqlServerCeSqlCeProviderServices_Instance()
System.Data.SqlServerCe.SqlCeProviderFactory.System.IServiceProvider.GetService(Type
serviceType)
System.Data.Common.DbProviderServices.GetProviderServices(DbProviderFactory
factory)
System.Data.Common.DbProviderServices.GetProviderServices(DbConnection
connection)
System.Data.Entity.ModelConfiguration.Internal.Configuration.CodeFirstCachedMetadataWorkspace.GetMetadataWorkspace(DbConnection
storeConnection)
System.Data.Entity.Infrastructure.DbModel.CreateObjectContext[TContext](DbConnection
existingConnection)
System.Data.Entity.Internal.LazyInternalContext.InitializeFromModel(DbModel
model)
System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
System.Data.Entity.Internal.InternalContext.Initialize()
System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type
entityType)
System.Data.Entity.Internal.Linq.EfInternalQuery1.Initialize()
System.Data.Entity.Internal.Linq.EfInternalQuery1.Include(String
path)
System.Data.Entity.Infrastructure.DbQuery`1.Include(String
path)
MyProjet.Areas.Administration.Models.BusinessModel.GetBusinesses()
in
D:\projects2010\MyProjet\MyProjet\Areas\Administration\Models\BusinessModel.cs:
line 47
MyProjet.Tests.Administration.ModlelTests.Business.TestGetBusinessesList()
in
D:\projects2010\MyProjet\MyProjet.Tests\Administration\ModlelTests\Business.cs:
line 45
I have tried replacing the existing MyData connection string in the MVC application, and it works fine. It only causes this problem when this is added to the Testing project. Additionally the testing project works without problem when pointed at an SQL or SQL Express Database.
Have been struggling with this for a while now, and just can't figure it out. I am sure I have overlooked something simple.
Try using
Database.DefaultConnectionFactory = new SqlCeConnectionFactory("System.Data.SqlServerCe.4.0");
See my blog post for an example http://www.arrangeactassert.com/code-first-entity-framework-unit-test-examples/
I have been running the tests under the Built in Microsoft testing framework. Changing the test framework to NUnit (as in Jag's tutorial) has fixed the problem.
So looks like there is a conflict between SqlServerCe and the Visual Studio Unit Testing Framework.