I use Mono 2.6.4 compiled from source on CentOS to compile a VS2008 project in C#.
Some csproj compile, but this one doesn't, here is the output of xbuild /t:detailed :
/opt/mono-2.6.4/lib/mono/2.0/Microsoft.CSharp.targets: error : Error executing task Csc: Input string was not in the correct format
Error executing task Csc: System.FormatException: Input string was not in the correct format
at System.Int32.Parse (System.String s) [0x00000] in <filename unknown>:0
at Microsoft.Build.Utilities.ToolTask.ParseOrigin (System.String origin, System.String& filename, System.Int32& lineNumber, System.Int32& columnNumber, System.Int32& endLineNumber, System.Int32& endColumnNumber) [0x00000] in <filename unknown>:0
at Microsoft.Build.Utilities.ToolTask.LogEventsFromTextOutput (System.String singleLine, MessageImportance importance) [0x00000] in <filename unknown>:0
at Microsoft.Build.Utilities.ToolTask.ProcessOutputFile (System.String filename, MessageImportance importance) [0x00000] in <filename unknown>:0
at Microsoft.Build.Utilities.ToolTask.ExecuteTool (System.String pathToTool, System.String responseFileCommands, System.String commandLineCommands) [0x00000] in <filename unknown>:0
at Microsoft.Build.Utilities.ToolTask.Execute () [0x00000] in <filename unknown>:0
at Microsoft.Build.BuildEngine.TaskEngine.Execute () [0x00000] in <filename unknown>:0
at Microsoft.Build.BuildEngine.BuildTask.Execute () [0x00000] in <filename unknown>:0
Task "Csc" execution -- FAILED
Done building target "CoreCompile" in project "/mnt/virtualbox/Project/(API)/Base/Base.csproj".-- FAILED
OnError for target CoreBuild skipped due to false condition: '$(RunPostBuildEvent)' == 'Always' or '$(RunPostBuildEvent)' == 'OnOutputUpdated'
Target _GetCompileOutputsForClean:
Done building target "_GetCompileOutputsForClean" in project "/mnt/virtualbox/Project/(API)/Base/Base.csproj".
Target _RecordCleanFile:
Done building target "_RecordCleanFile" in project "/mnt/virtualbox/Project/(API)/Base/Base.csproj".
Done building project "/mnt/virtualbox/Project/(API)/Base/Base.csproj".-- FAILED
Anyone has an idea ? Thanks ?
This might already be fixed in svn. I changed that code to use regex some time back. Could you try this with a mono daily build [1]? Or just file a bug with the project file and i'll check it.
http://mono.ximian.com/daily/
It's probably a bug in xbuild. File a bug with a test case to get it fixed:
http://www.mono-project.com/Bugs
Related
I just wanted to test my Firebase implementation and realized that I get an error saying that Unity can't find the generate_xml_from_google_services_json.exe even though it is where it should be.
Entire Error:
Unable to find command line tool D:/Philipp's D Dokumente/Coding/C#/Unity/Multi-Case Clicker/Assets\..\Assets\Firebase\Editor\generate_xml_from_google_services_json.exe required for Firebase Android resource generation.
D:/Philipp's D Dokumente/Coding/C#/Unity/Multi-Case Clicker/Assets\..\Assets\Firebase\Editor\generate_xml_from_google_services_json.exe is required to generate the Firebase Android resource file google-services.xml from Assets/google-services.json. Without Firebase Android resources, your app will fail to initialize.
D:/Philipp's D Dokumente/Coding/C#/Unity/Multi-Case Clicker/Assets\..\Assets\Firebase\Editor\generate_xml_from_google_services_json.exe was distributed with each Firebase Unity SDK plugin, was it deleted?
System.ComponentModel.Win32Exception: ApplicationName='D:/Philipp's D Dokumente/Coding/C#/Unity/Multi-Case Clicker/Assets\..\Assets\Firebase\Editor\generate_xml_from_google_services_json.exe', CommandLine='-i "Assets/google-services.json" -l', CurrentDirectory='D:\Philipp's D Dokumente\Coding\C#\Unity\Multi-Case Clicker'
at System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in <filename unknown>:0
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 (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Start ()
at GooglePlayServices.CommandLine.RunViaShell (System.String toolPath, System.String arguments, System.String workingDirectory, System.Collections.Generic.Dictionary`2 envVars, GooglePlayServices.IOHandler ioHandler, Boolean useShellExecution, Boolean stdoutRedirectionInShellMode) [0x00000] in <filename unknown>:0
at GooglePlayServices.CommandLine.Run (System.String toolPath, System.String arguments, System.String workingDirectory, System.Collections.Generic.Dictionary`2 envVars, GooglePlayServices.IOHandler ioHandler) [0x00000] in <filename unknown>:0
at Firebase.Editor.GenerateXmlFromGoogleServicesJson.RunResourceGenerator (System.String arguments, System.String inputPath, Boolean showCommandLine) [0x00000] in <filename unknown>:0
UnityEngine.Debug:LogError(Object)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:RunResourceGenerator(String, String, Boolean)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:ReadBundleIds(String)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:ReadBundleIdsFromGoogleServicesFiles()
Firebase.Editor.GenerateXmlFromGoogleServicesJson:UpdateJsonWithBundleIdChooserDialog(String, Boolean)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:CheckConfiguration()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
Also when I try to Force-Resolve I get this:
Resolution failed
Failed to fetch the following dependencies:
com.google.firebase:firebase-app-unity:4.2.0#aar
com.google.firebase:firebase-auth-unity:4.2.0#aar
UnityEngine.Debug:LogError(Object)
GooglePlayServices.PlayServicesResolver:LogDelegate(String, LogLevel)
Google.JarResolver.PlayServicesSupport:Log(String, LogLevel, Boolean)
GooglePlayServices.ResolverVer1_1:LogMissingDependenciesError(List`1)
GooglePlayServices.<DoResolutionUnsafe>c__AnonStorey4:<>m__1(List`1)
GooglePlayServices.<GradleResolution>c__AnonStorey0:<>m__0(Result)
GooglePlayServices.<GradleResolution>c__AnonStorey1:<>m__0()
GooglePlayServices.PlayServicesResolver:PumpUpdateQueue()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
I use the method GetCustomAttributes from the extension class CustomAttributeExtensions:
var serviceInterface = service.GetInterfaces().FirstOrDefault(i => i.GetCustomAttributes().Contains(new ServiceContractAttribute()));
When I run my application under mono 4.0 on debian I get the following exception:
Missing method GetCustomAttributes in assembly /root/mkmServer/MKMWatcher.Services.exe, type System.Reflection.CustomAttributeExtensions
Unhandled Exception: System.TypeLoadException: Could not load type 'System.Reflection.CustomAttributeExtensions' from assembly 'MKMWatcher.Services'.
at System.Linq.Enumerable.First[Type] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback) [0x00000] in <filename unknown>:0
at System.Linq.Enumerable.FirstOrDefault[Type] (IEnumerable`1 source, System.Func`2 predicate) [0x00000] in <filename unknown>:0
at MKMWatcher.Services.ServiceManager.CreateService (System.Type service, System.String serviceAddress) [0x00000] in <filename unknown>:0
at MKMWatcher.Services.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'System.Reflection.CustomAttributeExtensions' from assembly 'MKMWatcher.Services'.
at System.Linq.Enumerable.First[Type] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback) [0x00000] in <filename unknown>:0
at System.Linq.Enumerable.FirstOrDefault[Type] (IEnumerable`1 source, System.Func`2 predicate) [0x00000] in <filename unknown>:0
at MKMWatcher.Services.ServiceManager.CreateService (System.Type service, System.String serviceAddress) [0x00000] in <filename unknown>:0
at MKMWatcher.Services.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
When I decompile the mscorlib.dll from mono which should contain the class I don't find it in his namespace:
But when I take a look at the mono github repository, the class is present: https://github.com/mono/mono/blob/master/mcs/class/referencesource/mscorlib/system/reflection/CustomAttributeExtensions.cs
Do you know what's happening ? Are the assemblies deployed in the latest version of mono not reflecting... their source code ? The file haven't been touched for a while and it's not like it was a new feature... Any ideas ? Any solution that does not involve for me to get the latest mono source and compile them by hand ?
Thank you in advance for you answers.
Just started getting this compiler error:
Internal compiler error. See the console log for more information. output
was:
Unhandled Exception: System.InvalidCastException: Cannot cast from source type to destination type.
at Mono.CSharp.PendingImplementation.BaseImplements (System.Type iface_type, System.Reflection.MethodInfo mi, System.Reflection.MethodInfo& base_method) [0x00000] in <filename unknown>:0
at Mono.CSharp.PendingImplementation.VerifyPendingMethods (Mono.CSharp.Report Report) [0x00000] in <filename unknown>:0
at Mono.CSharp.TypeContainer.EmitType () [0x00000] in <filename unknown>:0
at Mono.CSharp.RootContext.EmitCode () [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
I was casting a component to an interface type, which was working fine (compiling and working right at runtime). I did the same in another method and this started, I quickly reverted my changes to the method and this error continues. I am honestly not sure how to resolve it, and google was not bringing up a whole lot of useful information.
Unity 4.6.3
Let me know if you need more information. Or if this is the wrong place to ask for assistance. Any ideas?
Edit: Going through and systematically removing my casts from Component to IPlayerObject (which is an interface).
I am trying to run my MVC application based on ASP.Net with the MVC 4 technology and the EntityFramework.
public ActionResult Test()
{
DbEntities entities = new DbEntities();
ViewBag.AddressBookList = entities.ADDRESSBOOK.Take(100).ToList();
return View();
}
The problem is that I'm getting this exception when I'm calling /Home/Test. It must be caused by the EntityFramework because the whole application works except to the point when I'm trying to retrieve data of the database with the EntityFramework. When I test it within Visual Studio (IIS) it runs properly without any error.
System Informations
Windows
Net Framework 4.0
ASP .Net MVC 4
EntityFramework 6
Mono 3.2.3 (newest Windows version)
nginx FastCGI with fastcgi-mono-server4
System.UriFormatException
Invalid URI: The format of the URI could not be determined:
System.Data.Resources.SqlClient.SqlProviderServices.ProviderManifest.xml
Stacktrace
at System.Uri..ctor (System.String uriString, Boolean dontEscape) [0x00000] in <filename unknown>:0
at System.Uri..ctor (System.String uriString) [0x00000] in <filename unknown>:0
at Mono.Xml.Schema.XmlSchemaValidatingReader..ctor (System.Xml.XmlReader reader, System.Xml.XmlReaderSettings settings) [0x00000] in <filename unknown>:0
at System.Xml.XmlReader.CreateValidatingXmlReader (System.Xml.XmlReader reader, System.Xml.XmlReaderSettings settings) [0x00000] in <filename unknown>:0
at System.Xml.XmlReader.CreateFilteredXmlReader (System.Xml.XmlReader reader, System.Xml.XmlReaderSettings settings) [0x00000] in <filename unknown>:0
at System.Xml.XmlReader.Create (System.Xml.XmlReader reader, System.Xml.XmlReaderSettings settings) [0x00000] in <filename unknown>:0
at System.Data.Entity.Core.SchemaObjectModel.Schema.Parse (System.Xml.XmlReader sourceReader, System.String sourceLocation) [0x00000] in <filename unknown>:0
at System.Data.Entity.Core.SchemaObjectModel.SchemaManager.ParseAndValidate (IEnumerable`1 xmlReaders, IEnumerable`1 sourceFilePaths, SchemaDataModelOption dataModel, System.Data.Entity.Core.SchemaObjectModel.AttributeValueNotification providerNotification, System.Data.Entity.Core.SchemaObjectModel.AttributeValueNotification providerManifestTokenNotification, System.Data.Entity.Core.SchemaObjectModel.ProviderManifestNeeded providerManifestNeeded, IList`1& schemaCollection) [0x00000] in <filename unknown>:0
at System.Data.Entity.Core.SchemaObjectModel.SchemaManager.ParseAndValidate (IEnumerable`1 xmlReaders, IEnumerable`1 sourceFilePaths, SchemaDataModelOption dataModel, System.Data.Entity.Core.Common.DbProviderManifest providerManifest, IList`1& schemaCollection) [0x00000] in <filename unknown>:0
at System.Data.Entity.Core.SchemaObjectModel.SchemaManager.LoadProviderManifest (System.Xml.XmlReader xmlReader, System.String location, Boolean checkForSystemNamespace, System.Data.Entity.Core.SchemaObjectModel.Schema& schema) [0x00000] in <filename unknown>:0
at System.Data.Entity.Core.Common.DbXmlEnabledProviderManifest.Load (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at System.Data.Entity.Core.Common.DbXmlEnabledProviderManifest..ctor (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at System.Data.Entity.SqlServer.SqlProviderManifest..ctor (System.String manifestToken) [0x00000] in <filename unknown>:0
at System.Data.Entity.SqlServer.SqlProviderServices.GetDbProviderManifest (System.String versionHint) [0x00000] in <filename unknown>:0
at System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifest (System.String manifestToken) [0x00000] in <filename unknown>:0
This issue is caused by Entity Framework generating invalid XML. For some reason, Microsoft's implementation of XmlReader doesn't follow the spec while Mono's does. Fortunately for most Mono users, the issue was patched in Mono nearly a year ago. You can view the pull request here:
https://github.com/mono/mono/pull/756
Unfortunately that doesn't help you since the latest version of Mono for Windows is over a year old. You can look at the issue in more depth at:
https://entityframework.codeplex.com/workitem/1632
Which may also help if you want to pull down the Entity Framework source and build from scratch with the patched code. If you can figure out the proper way, you may also be able to manually edit the offending XML so that it is valid and would no longer cause the Mono XML Reader to throw an Exception.
Of course, since you're already running on Windows, you could simply use IIS and avoid the issue completely.
Another issue dealing with MonoMac. I cant even create a bundle, if I do so I get this error.
Creating app bundle
Contents/Info.plist
Contents/PkgInfo
Contents/Resources/MainMenu.nib
Contents/Resources/MainWindow.nib
Contents/Resources/PrefForm.nib
Contents/Resources/SearchForm.nib
Contents/Resources/StreamInformation.nib
Contents/Resources/sd.icns
Contents/Resources/build/StreamDesk.build/StreamDesk.pbxindex/categories.pbxbtree
Contents/Resources/build/StreamDesk.build/StreamDesk.pbxindex/cdecls.pbxbtree
Contents/Resources/build/StreamDesk.build/StreamDesk.pbxindex/decls.pbxbtree
Contents/Resources/build/StreamDesk.build/StreamDesk.pbxindex/files.pbxbtree
Contents/Resources/build/StreamDesk.build/StreamDesk.pbxindex/imports.pbxbtree
Contents/Resources/build/StreamDesk.build/StreamDesk.pbxindex/pbxindex.header
Contents/Resources/build/StreamDesk.build/StreamDesk.pbxindex/protocols.pbxbtree
Contents/Resources/build/StreamDesk.build/StreamDesk.pbxindex/refs.pbxbtree
Contents/Resources/build/StreamDesk.build/StreamDesk.pbxindex/subclasses.pbxbtree
Contents/Resources/build/StreamDesk.build/StreamDesk.pbxindex/symbols0.pbxsymbols
Contents/Resources/build/StreamDesk.build/StreamDesk.pbxindex/strings.pbxstrings/control
Contents/Resources/build/StreamDesk.build/StreamDesk.pbxindex/strings.pbxstrings/strings
Merging Mono into app bundle
/Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MonoMac/mmp -o "/tmp/monomac-build-634642319384392990" -n "StreamDesk" -a "/Users/michaelmanley/Desktop/NasuTek-StreamDesk/libstreamdesk/Managed/StreamDesk.Core/bin/Debug/StreamDesk.Managed.dll" -a "/Library/Frameworks/Mono.framework/Versions/2.10.8/lib/mono/4.0/System.dll" -a "/Library/Frameworks/Mono.framework/Versions/2.10.8/lib/mono/4.0/System.Xml.dll" -a "/Library/Frameworks/Mono.framework/Versions/2.10.8/lib/mono/4.0/System.Core.dll" -a "/Library/Frameworks/Mono.framework/Versions/2.10.8/lib/mono/4.0/System.Xml.Linq.dll" -a "/Library/Frameworks/Mono.framework/Versions/2.10.8/lib/mono/4.0/System.Drawing.dll" -a "/Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MonoMac/MonoMac.dll" -a "/Library/Frameworks/Mono.framework/Versions/2.10.8/lib/mono/4.0/System.Data.dll" -a "/Library/Frameworks/Mono.framework/Versions/2.10.8/lib/mono/4.0/System.Data.DataSetExtensions.dll" -a "/Users/michaelmanley/Desktop/NasuTek-StreamDesk/3rdParty/Mono.Addins.dll" "/Users/michaelmanley/Desktop/NasuTek-StreamDesk/StreamDesk-Cocoa/bin/Debug/StreamDesk.exe"
Could not link assemblies: System.ArgumentException: Member 'System.Int32 Mono.Addins.Database.SetupProcess::Main(System.String[])' is declared in another module and needs to be imported
at Mono.Cecil.MetadataBuilder.LookupToken (IMetadataTokenProvider provider) [0x00000] in <filename unknown>:0
at Mono.Cecil.MetadataBuilder.BuildModule () [0x00000] in <filename unknown>:0
at Mono.Cecil.MetadataBuilder.BuildMetadata () [0x00000] in <filename unknown>:0
at Mono.Cecil.ModuleWriter.<BuildMetadata>b__0 (Mono.Cecil.MetadataBuilder builder, Mono.Cecil.MetadataReader _) [0x00000] in <filename unknown>:0
at Mono.Cecil.ModuleDefinition.Read[MetadataBuilder,MetadataBuilder] (Mono.Cecil.MetadataBuilder item, System.Func`3 read) [0x00000] in <filename unknown>:0
at Mono.Cecil.ModuleWriter.BuildMetadata (Mono.Cecil.ModuleDefinition module, Mono.Cecil.MetadataBuilder metadata) [0x00000] in <filename unknown>:0
at Mono.Cecil.ModuleWriter.WriteModuleTo (Mono.Cecil.ModuleDefinition module, System.IO.StreamFailed to link /Users/michaelmanley/Desktop/NasuTek-StreamDesk/StreamDesk-Cocoa/bin/Debug/StreamDesk.exe
stream, Mono.Cecil.WriterParameters parameters) [0x00000] in <filename unknown>:0
at Mono.Cecil.ModuleDefinition.Write (System.IO.Stream stream, Mono.Cecil.WriterParameters parameters) [0x00000] in <filename unknown>:0
at Mono.Cecil.ModuleDefinition.Write (System.String fileName, Mono.Cecil.WriterParameters parameters) [0x00000] in <filename unknown>:0
at Mono.Cecil.AssemblyDefinition.Write (System.String fileName, Mono.Cecil.WriterParameters parameters) [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.OutputStep.OutputAssembly (Mono.Cecil.AssemblyDefinition assembly) [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.OutputStep.ProcessAssembly (Mono.Cecil.AssemblyDefinition assembly) [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.BaseStep.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0
at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0
at MonoMac.Tuner.Linker.Run (Mono.Linker.Pipeline pipeline, Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0
mmp exited with code 1
Merging Mono failed
I did include a build of Mono.Addins but theres nothing that even remotely calls such a function, and Im lost at why it WANTS that. Just not having a good day with Mono.
If you wanna have a shot the source code is at https://github.com/NasuTek/NasuTek-StreamDesk
I figured it out, when I use the option "Don't Link Assemblies" it works all well.