After attempting to change my existing project from beta 8 to RC1 I get the following after running dnx ef migrations add Init
System.TypeLoadException: Could not load type 'Microsoft.Data.Entity.Scaffolding.SqliteDesignTimeServices, EntityFramework.Sqlite.Design'.
at Microsoft.Data.Entity.Design.Internal.DesignTimeServicesBuilder.ConfigureProviderServices (System.String provider, IServiceCollection services, Boolean throwOnError) [0x00000] in <filename unknown>:0
at Microsoft.Data.Entity.Design.Internal.DesignTimeServicesBuilder.Build (Microsoft.Data.Entity.DbContext context) [0x00000] in <filename unknown>:0
at Microsoft.Data.Entity.Design.MigrationsOperations.AddMigration (System.String name, System.String outputDir, System.String contextType) [0x00000] in <filename unknown>:0
at Microsoft.Data.Entity.Commands.Program+Executor+<>c__DisplayClass6_0.<AddMigration>b__0 () [0x00000] in <filename unknown>:0
at Microsoft.Data.Entity.Commands.Program+Executor.Execute (System.Action action) [0x00000] in <filename unknown>:0
Could not load type 'Microsoft.Data.Entity.Scaffolding.SqliteDesignTimeServices, EntityFramework.Sqlite.Design'.
My project.json file contains along with others the following
"dependencies": {
"EntityFramework.Commands": "7.0.0-rc1-final",
"EntityFramework.SQLite": "7.0.0-rc1-final"
},
"commands": {
"ef": "EntityFramework.Commands"
},
What do I need to do to resolve this error?
Package names are case-sensitive on Linux and OS X due to the case-sensitive filesystem. Make sure to use EntityFramework.Sqlite not EntityFramework.SQLite in your project.json file. (See GitHub Issue dotnet/cli#236)
First resolve your references / dependencies. All reference warnings must be solved and must be "7.0.0-rc1-final".
If there is no "7.0.0-rc1-final" version then probably something is renamed to a different name. See the annoncement repro for breaking changes
"dependencies": {
"EntityFramework.Commands": "7.0.0-rc1-final",
"EntityFramework.SQLite": "7.0.0-rc1-final"
},
Related
I've just upgraded to Unity5 and a small .dll I've made started to give the following error:
Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0
at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in <filename unknown>:0
at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in <filename unknown>:0
at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in <filename unknown>:0
at Mono.CSharp.Driver.LoadReferences () [0x00000] in <filename unknown>:0
at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0
at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0
Missing method .ctor in assembly [myproj... .dll], type System.Runtime.Versioning.TargetFrameworkAttribute
The class System.Runtime.Versioning.TargetFrameworkAttribute could not be loaded, used in Logger
Can't find custom attr constructor image: [myproj... .dll]
mtoken: 0x0a00000e
The .dll worked perfectly before updating to Unity 5, and I did recompile the .dll with the unity5 version UnityEngine.dll (needed by my library), but that didn't help. Any ideas how to fix this?
I'm doing on some basic Roslyn stuff, and have run into what appears to be a mono compatibility issue. Wanted to make sure I'm not doing something wrong and hear other people's experience. Am using Roslyn from the Microsoft.CodeAnalysis nuget, version 0.7.4091001-beta (latest).
var mscorlib = new MetadataFileReference(typeof(object).Assembly.Location);
var compilation = CSharpCompilation.Create("Temp", new SyntaxTree[0], new[] { mscorlib });
compilation.GetAssemblyOrModuleSymbol(mscorlib);
While this works on Microsoft .NET, on mono on Linux the last line produces the following exception:
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentException: Absolute path expected.
Parameter name: fullPath
at Microsoft.CodeAnalysis.CommonReferenceManager`2[Microsoft.CodeAnalysis.CSharp.CSharpCompilation,Microsoft.CodeAnalysis.CSharp.Symbols.AssemblySymbol].ResolveMetadataReferences (Microsoft.CodeAnalysis.CSharp.CSharpCompilation compilation, System.Collections.Immutable.ImmutableArray`1& references, IDictionary`2& boundReferenceDirectiveMap, System.Collections.Immutable.ImmutableArray`1& boundReferenceDirectives, System.Collections.Immutable.ImmutableArray`1& assemblies, System.Collections.Immutable.ImmutableArray`1& modules, Microsoft.CodeAnalysis.DiagnosticBag diagnostics) [0x00000] in <filename unknown>:0
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation+ReferenceManager.CreateAndSetSourceAssemblyFullBind (Microsoft.CodeAnalysis.CSharp.CSharpCompilation compilation) [0x00000] in <filename unknown>:0
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation+ReferenceManager.CreateSourceAssemblyForCompilation (Microsoft.CodeAnalysis.CSharp.CSharpCompilation compilation) [0x00000] in <filename unknown>:0
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetBoundReferenceManager () [0x00000] in <filename unknown>:0
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetAssemblyOrModuleSymbol (Microsoft.CodeAnalysis.MetadataReference reference) [0x00000] in <filename unknown>:0
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.CommonGetAssemblyOrModuleSymbol (Microsoft.CodeAnalysis.MetadataReference reference) [0x00000] in <filename unknown>:0
at Microsoft.CodeAnalysis.Compilation.GetAssemblyOrModuleSymbol (Microsoft.CodeAnalysis.MetadataReference reference) [0x00000] in <filename unknown>:0
at playground2.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0
There's obviously some sort of path parsing Linux/Windows sadness going on here. My current workaround is to create the reference to corlib thus:
var mscorlibMetadata = AssemblyMetadata.CreateFromImageStream(new FileStream(typeof(object).Assembly.Location, FileMode.Open, FileAccess.Read));
var mscorlib = new MetadataImageReference (mscorlibMetadata);
Does anybody know anything about this?
This is a bug in Roslyn.
You can send them a pull request to fix PathUtilities.GetPathKind to be aware of Linux-style paths by checking Path.DirectorySeparatorChar.
I have recently installed MonoDevelop V3.0.3.2 on Linux Mint 15 MATE 64-bit.
I installed MonoDevelop through the Software Manager
I attempted to create a new project per http://monodevelop.com/Documentation/Creating_A_Simple_Solution
Unfortunately I receive an error on attempting to build that the filename has not been set. Details of error received are as follows.
System.InvalidOperationException: File name has not been set
at System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in <filename unknown>:0
at System.Diagnostics.Process.Start () [0x00000] in <filename unknown>:0
at MonoDevelop.Core.Execution.ProcessWrapper.Start () [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) MonoDevelop.Core.Execution.ProcessWrapper:Start ()
at MonoDevelop.Platform.GnomePlatform.StartConsoleProcess (System.String command, System.String arguments, System.String workingDirectory, IDictionary`2 environmentVariables, System.String title, Boolean pauseWhenFinished) [0x00000] in <filename unknown>:0
at MonoDevelop.Core.Execution.ProcessService.StartConsoleProcess (System.String command, System.String arguments, System.String workingDirectory, IDictionary`2 environmentVariables, IConsole console, System.EventHandler exited) [0x00000] in <filename unknown>:0
at MonoDevelop.Debugger.Soft.SoftDebuggerEngine+<CreateDebuggerStartInfo>c__AnonStorey1.<>m__6 (System.Diagnostics.ProcessStartInfo info) [0x00000] in <filename unknown>:0
at Mono.Debugger.Soft.VirtualMachineManager.BeginLaunch (System.Diagnostics.ProcessStartInfo info, System.AsyncCallback callback, Mono.Debugger.Soft.LaunchOptions options) [0x00000] in <filename unknown>:0
at Mono.Debugging.Soft.SoftDebuggerSession.StartLaunching (Mono.Debugging.Soft.SoftDebuggerStartInfo dsi) [0x00000] in <filename unknown>:0 at Mono.Debugging.Soft.SoftDebuggerSession.OnRun (Mono.Debugging.Client.DebuggerStartInfo startInfo) [0x00000] in <filename unknown>:0
at Mono.Debugging.Client.DebuggerSession+<Run>c__AnonStorey6.<>m__3 () [0x00000] in <filename unknown>:0
How does one set the filename in Monodevelop?
EDIT: The Build of the project is working , Problem is occurring when attempting to run the application in the IDE
I had the same issue. I found out that if you install xterm, and restart monodevelop the error will be resolved. Apparently xterm is a dependency. Just go to terminal and "sudo apt-get install xterm".
I have embedded mono in a c++ program and loaded a dll which requires an app.config. I am getting this kind of error, does someone have an idea on how to ship *.config with an embedded mono ?
The stack trace :
System.Configuration.ConfigurationErrorsException: Error Initializing the configuration system. ---> System.ArgumentException: The 'ExeConfigFilename' argument cannot be null.
at System.Configuration.ExeConfigurationHost.CheckFileMap (ConfigurationUserLevel level, System.Configuration.ExeConfigurationFileMap map) [0x00000] in <filename unknown>:0
at System.Configuration.ExeConfigurationHost.InitForConfiguration (System.String& locationSubPath, System.String& configPath, System.String& locationConfigPath, IInternalConfigRoot root, System.Object[] hostInitConfigurationParams) [0x00000] in <filename unknown>:0
at System.C[] hostInitConfigurationParams) [0x00000] in <filename unknown>:0
at System.Configuration.ConfigurationManager.OpenExeConfigurationInternal (ConfigurationUserLevel userLevel, System.Reflection.Assembly calling_assembly, System.String exePath) [0x00000] in <filename unknown>:0
at System.Configuration.ClientConfigurationSystem.get_Configuration () [0x00000] in <filename unknown>:0 onfiguration.InternalConfigurationSystem.InitForConfiguration (System.String& locationConfigPath, System.String& parentConfigPath, System.String& parentLocationConfigPath) [0x00000] in <filename unknown>:0
at System.Configuration.Configuration..ctor (System.Configuration.InternalConfigurationSystem system, System.String locationSubPath) [0x00000] in <filename unknown>:0
at System.Configuration.InternalConfigurationFactory.Create (System.Type typeConfigHost, System.Object
Self answer : you can't (as of 2013-04-30). To enable this behaviour, I had to change mono's framework sources mono/mcs/class/corlib/system/appdomain.cs :
public AppDomainSetup SetupInformation {
get {
return SetupInformationNoCopy; // newline
// AppDomainSetup setup = getSetup (); //old
// return new AppDomainSetup (setup); //old
}
}
When trying to add a reference to a ASMX with WCF I get the following ewrror. Using the .NET 2.0 services option however works fine:
System.NullReferenceException: Object reference not set to an instance of an object
at Mono.ServiceContractTool.MoonlightChannelBaseOperationExtension.FixupAsync () [0x00000] in <filename unknown>:0
at Mono.ServiceContractTool.MoonlightChannelBaseOperationExtension.Fixup () [0x00000] in <filename unknown>:0
at Mono.ServiceContractTool.MoonlightChannelBaseContext.Fixup () [0x00000] in <filename unknown>:0
at MonoDevelop.WebReferences.WCF.WebServiceDiscoveryResultWCF.CreateProxyFile (MonoDevelop.Projects.DotNetProject dotNetProject, FilePath basePath, System.String proxyNamespace, System.String referenceName) [0x00000] in <filename unknown>:0
at MonoDevelop.WebReferences.WebServiceDiscoveryResult.GenerateFiles (MonoDevelop.Projects.DotNetProject project, System.String namspace, System.String referenceName) [0x00000] in <filename unknown>:0
at MonoDevelop.WebReferences.Commands.WebReferenceCommandHandler.NewWebReference () [0x00000] in <filename unknown>:0
Mono does not have a compatible version of SlSvcUtil.exe, so you need to use the slsvcutil that Microsoft provides as part of the Silverlight 3.0 Tools to generate the client proxy.
http://wiki.monotouch.net/HowTo/WebServices/Using_WCF