c++ - How to create a dll for one class that reference other dlls in c# asp.net? -
i have following class trying make dll from
using system; using system.collections.generic; using system.linq; using system.web; using nrules.fluent.dsl; using nrule.site.model; using nrule.site.utilities; namespace nrule.site.rules { public class allowatleastonecountryrule : rule { public override void define() { fundprofile productprofile = null; string str = ruletexts.allowatleastonecountryrule; bool enabled = allrules.getdict()[str]; when() .match<fundprofile>(() => productprofile) .exists<fundprofile>( p => enabled, p => ruleviolation(p)); then() .do(_ => productprofile.displayerror(str)); } bool ruleviolation(fundprofile pp) { if (pp.countrieslistp.count==0) return true; if (pp.countrieslistp.any(c => c.allowed)) return false; else return true; } } }
as can see has external reference
using nrules.fluent.dsl;
and other classes in hierarchy
using nrule.site.model; using nrule.site.utilities;
when try csc command this
csc /target:library /out:mylib.dll allowatleastonecountryrule.cs microsoft (r) visual c# compiler version 4.0.30319.34209 microsoft (r) .net framework 4.5 copyright (c) microsoft corporation. rights reserved. allowatleastonecountryrule.cs(5,7): error cs0246: type or namespace name 'nrules' not found (are missing using directive or assembly reference?) allowatleastonecountryrule.cs(6,18): error cs0234: type or namespace name 'model' not exist in namespace 'nrule.site' (are missing assembly reference?) allowatleastonecountryrule.cs(7,18): error cs0234: type or namespace name 'utilities' not exist in namespace 'nrule.site' (are missing assembly reference?) allowatleastonecountryrule.cs(11,47): error cs0246: type or namespace name 'rule' not found (are missing using directive or assembly reference?) allowatleastonecountryrule.cs(27,28): error cs0246: type or namespace name 'fundprofile' not found (are missing using directive or assembly reference?)
how can reference assemblies , compile class dll? guidance great.
you should specify addition assemblies in command referenced in code.
csc /target:library reference:assembly_contained_your_types.dll /out:mylib.dll allowatleastonecountryrule.cs
Comments
Post a Comment