Timeline for C# dynamically linking different libraries and/or external classes
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 7, 2014 at 18:55 | comment | added | Bobson | @JamieTaylor - As per svick's comment above, if you don't include it, you still won't get exceptions at runtime if you never try to call it. | |
Jan 7, 2014 at 12:23 | comment | added | fejesjoco | You don't have to include it ever. If you load the library with reflection, then naturally there is no strong dependency, so you don't load it if it's not there. If there is an assembly reference, then I'm pretty sure you'll have no problems until you step into a method that does require that assembly. But of course it's a lot safer to include it after you compiled it with a strong reference. | |
Jan 7, 2014 at 12:21 | comment | added | Jamie Taylor | Excellent, thank you. If we had gone down the runtime route, we'd have to include the licensed library with our build right? Otherwise we'd get exceptions thrown at runtime if we tried to Invoke something that cannot be found, right? | |
Jan 7, 2014 at 12:21 | vote | accept | Jamie Taylor | ||
Jan 7, 2014 at 12:19 | comment | added | fejesjoco | OK. You can google preprocessor directives, you can drive them directly with conditional compilation symbols from Visual Studio, or MSBuild logic. Outside Visual Studio, you can put conditions on mostly anything in a .csproj file, including <Reference> tags AFAIK. If you do that and later edit the project in Visual Studio, that could be problematic though, but generally, Visual Studio can handle these things just fine. | |
Jan 7, 2014 at 12:15 | comment | added | Jamie Taylor | We're going with compile time assembly references. Please ignore the "at run time" in the title, as it was a working title that I forgot to alter after I had written the question. | |
Jan 7, 2014 at 12:11 | history | answered | fejesjoco | CC BY-SA 3.0 |