Echo 8 ÉRÀ
Members-
Posts
60 -
Joined
-
Last visited
Reputation
0 NeutralProfile Information
-
About me
Rocketry Enthusiast
-
I just hope it runs well on Wine. I use FreeBSD for my desktop, so while I'd love to see a native port, realistically it'll never happen.
-
Well, there's your problem. Portable class libraries are there if you want to create a class library that supports desktop, metro-style desktop apps, Windows Phone apps, Silverlight. etc., and as a consequence, require a minimum level of .Net 4.0 (I think that's minimum metro apps support). Just recreate the project, except pick the non-portable Class Library project type.
-
I think only SDKs show up in the Programs and Features control panel applet (the "uninstall programs" tool I think you are referring to): S/he's also mentioned enabling it in the control panel, which presumably means the little dialog that appears if you click "Turn Windows features on or off". Hmm. Maybe they should check if .NET 3.5 is actually installed by checking if the folder actually exists: C:\Windows\Microsoft.NET\Framework\v3.5
-
Just for kicks, I tried to write your nested foreach loops (with KSPAddon instead of your attribute) with LINQ instead: private void FindAllCrewDataGenerators() { var generators = from type in ( (from asm in AssemblyLoader.loadedAssemblies select asm.assembly.GetTypes().AsEnumerable()) .Aggregate((first, second) => first.Concat(second))) where Attribute.IsDefined(type, typeof(KSPAddon)) select type; this.Generators = generators.ToList(); } The nested loops is more efficient and easier to understand, IMO.
-
I'm going to have to investigate this at some point. LINQ in KSP plugins, that is. While I haven't used LINQ itself, I have used the same classes and methods that LINQ is built on with no problems. EDIT: Ippo, would you mind posting a zip containing your project which crashes KSP? My quick and dirty test plugin loads fine, so I don't know if it's because the code is too trivial to trigger any problems or if I set project settings out of habit which allow me to use LINQ without any problems.
-
Why can't you use LINQ AND target .Net 3.5 at the same time? I don't have a handy C# project to test with, but I compiled and ran the following C++/CLI code just fine: using namespace System::Linq; bool attfilter(System::Type ^t); bool attfilter(System::Type ^t) { return System::Attribute::IsDefined(t, KSPAddon::typeid); } void Events::Start(void) { PDebug::Log("Events::Start()"); auto generators = Enumerable::Where(AssemblyLoader::loadedTypes, gcnew System::Func<System::Type ^, bool>(&attfilter)); auto Generators = Enumerable::ToList(generators); for each (auto g in Generators) { PDebug::Log(g->FullName); } }