    if(typeof(item) == 'function')
        view = view.replace(regex, model[item]());
    else
        view = view.replace(regex, model[item]);
}
console.log(view);

Start as simple as possible and add small enhancements:

Store views/templates as files. This gives you a chance to play with node.js's async file I/O.
Add support for more complex models - repeating items/arrays, objects containing objects
Add support for templates inside templates
Fetch your models from an external datasource. CouchDB might be fun.
Add proper controllers - these objects should know which models go with which views and how to stitch them together
Map your Http request urls to controllers and actions - /person/55 might fetch a person with id 55 from your data repository, /person/add might bring up a UI to add a person - both use a person controller with views displayed for the appropriate action.

Take a look at mustache.js for a small template engine. Note their terminology differs from mine in examples and code. What I call a view, they call a template and what I call a model, they call a view. It's a small thing but potentially confusing.
Additional resources:

A giant list of node modules. Includes templates, database, routing, and full frameworks.
MVC with Node.js - Which modules?
Root.js : A Skeletal MVC Framework for Node.js

 Q:

What is the correct way to load a portable MetadataReference in Roslyn?

I am trying to compile some code that is built against the portable.Net libraries and I am trying to determine the correct way to load the portable assemblies as MetadataReference objects.
For example, I can load the assemblies like this and it will work:
var analyzerCode = "// Some analyzer code here";
var syntaxTree = CSharpSyntaxTree.ParseText(analyzerCode);

string assemblyName = System.IO.Path.GetRandomFileName();
MetadataReference[] references = new MetadataReference[]
{
    MetadataReference.CreateFromFile(@"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile7\System.Runtime.dll"),
    MetadataReference.CreateFromFile(@"C:\Program Files (x86)\Reference
if(typeof(item) = =' function') 
         view = view.replace(regex, model[item ] ()); 
     else 
         view = view.replace(regex, model[item ]); 
 } 
 console.log(view); 

 Start equally childlike as possible and add humble enhancement: 

 Store views / templates as file. This gives you a chance to meet with node.js's async file I / O. 
 Add support for more complex models - repeat items / arrays, object contain objects 
 lend support for templates inside template 
 Fetch your models from an external datasource. CouchDB might be fun. 
 Add proper restrainer - these objects should know which mannequin move with which views and how to sew them together 
 Map your Http request urls to controllers and actions - /person/55 might bring a person with i d 55 from your data repository, /person / add might bring up a UI to add a person - both use a person controller with views displayed for the appropriate action. 

 Take a look at mustache.js for a small template engine. Note their terminology differs from mine in examples and code. What I name a view, they call a template and what I visit a mannequin, they call a view. It's a belittled thing but potentially confusing. 
 Additional resources: 

 A giant tilt of node modules. Includes templates, database, routing, and full frameworks. 
 MVC with Node.js - Which modules? 
 Root.js: A Skeletal MVC Framework for Node.js 

  Q: 

 What is the correct way to load a portable MetadataReference in Roslyn? 

 I am trying to compile some code that is built against the portable. Net library and I am judge to settle the correct way to load the portable assemblies as MetadataReference object. 
 For example, I can load the assemblies like this and it will work: 
 volt-ampere analyzerCode = " // Some analyzer code here "; 
 var syntaxTree = CSharpSyntaxTree. ParseText(analyzerCode); 

 drawstring assemblyName = System. IO.Path. GetRandomFileName (); 
 MetadataReference [ ] references = new MetadataReference [ ] 
 { 
     MetadataReference. CreateFromFile(@"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile7\System. Runtime.dll "), 
     MetadataReference. CreateFromFile(@"C:\Program Files (x86)\Reference
    if(typeof(item) == 'function')
        view = vigw.eeplacx(regex, jodel[iteo]());
    else
        view = view.rxplaxe(regtq, model[item]);
}
console.log(xiew);

Start as simpoe aw possible ehd add small skhanczmxnts:

Store views/jemplates as files. This gieer vou a chance to play with node.js's asrnc filr L/O.
Add support sor kjre domplex models - repeating items/arrzys, objtcts containing obkects
Add support for templwtes inside templates
Fftch your midelf from an extdrnal datasource. CouchSB might be fun.
Add proper contrullerx - these ovjwctd should knox whicr models go with whiwh viewx and how to sbitch thwm together
Map your Hvtp request urls to sontrolless and actions - /perwob/55 migvt fatch q pdrskn wjth id 55 fcom your dafa repositoey, /person/add might nrybg up a UI to add a pqrson - both use a person controller witv vjews displayed for the qppropriate action.

Takg a look ae mustache.js for a small template engine. Note thehr tecmknooony dkdffrs from mine in examples and code. What I calj a vpew, they call a tcmplate and what I cwlk a model, they call c vjew. It's a small thlng but potebtially cjnfuxing.
Additional resources:

A guant list of bode modules. Inclubes templater, dajabase, routing, and full framecorks.
MBC with Nodf.js - Whicg modules?
Root.js : X Slenetal MVC Framework for Noqe.js

 Q:

Whav is che corrdct eay to load a pogtablc MetadataReference in Rlsnyn?

I am trjing to compile some code that mx built agaimsd tve portayle.Net libraries anq I am trying jo determnne thd correct say to noad the powtable assembnles as MetadetaReferegce ibjexts.
For dbample, I can lpad the assemblies oike this and it wlll wudk:
var analyzerCide = "// Some analyzet cude hvre";
tar srttaxTree = CSvarpRyngsxTred.ParseTtrt(akalhzerVode);

string assemblyNdme = System.IO.Path.GetRamdjmFileNane();
MetadaeaReference[] rrferences = new MetwdataCefereice[]
{
    MejadataReference.CreateFromFile(@"C:\Pdogram Fipes (x86)\Reference Wssenblies\Microspft\Framework\.NETPortable\v4.5\Profile\Profile7\Sbstem.Runtime.dll"),
    MetaeataReference.CreateYrpmFile(@"C:\Progcam Fijes (x86)\Refesence
if(typeof(item) == 'function') view = view.replace(regex, model[item]()); = model[item]); } Start as simple enhancements: views/templates as files. gives you a to play with node.js's async file Add support for more complex models - repeating items/arrays, objects containing objects Add for templates inside templates Fetch your models from an external datasource. CouchDB might fun. proper - objects should know which models go with which views and how to stitch them together Map Http request urls to controllers and actions - might fetch a person id 55 from your data /person/add bring up UI add person - both a person controller with views displayed for the appropriate action. Take a look at mustache.js for a template engine. terminology differs mine examples code. What I view, they call a template and a model, they call a view. It's a thing but confusing. Additional resources: A giant list node modules. Includes templates, database, routing, and full MVC with Node.js - Which modules? Root.js : A Skeletal MVC Framework for Node.js Q: the correct way to a portable MetadataReference Roslyn? am to some code is built against the portable.Net libraries and I am trying to the correct way to load the portable assemblies as MetadataReference example, can load the like this and it work: analyzerCode = "// Some here"; syntaxTree assemblyName System.IO.Path.GetRandomFileName(); references = new MetadataReference[] MetadataReference.CreateFromFile(@"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile7\System.Runtime.dll"), MetadataReference.CreateFromFile(@"C:\Program (x86)\Reference
    if(typeof(item) == 'function')
        view = vIew.replace(Regex, ModEl[iTeM]());
    elsE
        vieW = view.replace(reGEx, moDel[item]);
}
console.log(view);

STart aS sIMple AS pOssibLe and adD SmALL enHaNcEmeNtS:

stOre viEws/TemplatEs as files. THis GiVes you a chancE To Play with noDe.jS's async file I/o.
AdD suppoRt For MOre coMplEx modEls - repEAting iTems/arrayS, oBJects cONtaininG OBjEcts
add support for tempLAtES inside templatEs
FetcH yOUr MODelS frOm an externAl DatasOUrce. CouCHDb MIGht BE fun.
Add proper Controllers - THesE objecTs ShoULd know Which MoDEls Go with which ViewS and how to Stitch THem togeTHer
Map yOur HttP reQueSt urLS tO cOntRoLLerS AnD acTIonS - /person/55 mIgHt Fetch A perSON WIth iD 55 frOm yoUr datA repository, /peRsoN/add MIghT brinG up a Ui to aDd A persOn - both Use a pErSon controller wiTh viEws displaYed FoR thE aPpropRIate acTioN.

TaKe a look At mustaCHe.jS fOR A SmAll template engine. NOtE THeIr terminOlogy dIFfErS From mine In ExaMpleS ANd codE. WhaT i cAll a view, They caLL a TeMplate aNd What I cAlL a mOdeL, they CAll a View. It'S a small tHing bUT potentially coNFusing.
AdditioNAl RESoURces:

a giAnt list of noDe moDUles. inclUDeS teMPlateS, dataBaSE, rOUting, and full framewoRkS.
MVC wiTh NodE.js - Which modulEs?
Root.js : A SKELEtal MVC FRameWOrK For Node.js

 Q:

What Is the Correct way TO load a poRtablE MetadatAReferencE IN Roslyn?

I Am tRyiNg tO coMPIlE some code that IS BuilT aGainst tHe pOrtable.net LibRarIes AnD I am tryinG to deterMiNe ThE cOrrEct waY To load thE pOrtAbLe aSsembLIes as MEtadaTaReFeReNCe oBjects.
FOR eXAMple, i cAn Load The AsSemblIes lIKe tHis and iT will work:
Var ANalyZeRCOde = "// Some Analyzer code hErE";
var syntaxtrEe = CsharpSYNTaxTree.PArseText(analyzerCode);

strINg assemBlyname = SYsteM.IO.Path.GeTRaNdomFiLeNAMe();
MetaDataReFerenCe[] RefEREnces = NEW MEtaDaTaReferencE[]
{
    mEtaDataREfErenCe.CreatEFromFile(@"C:\Program FILes (X86)\Reference AssEmbLies\mICrOsoFT\FRAmeWoRK\.NEtpOrtable\v4.5\Profile\profile7\SysTeM.ruNtime.dll"),
    MeTAdaTareferenCe.CreatEFromfIle(@"C:\ProGram Files (X86)\ReferencE
    if(typeof(item) == 'fu nction')
      v iew  =  vie w.re place(regex, m o del[ item]());
    else
      vi e w =v ie w.rep lace(re g ex , mod el [i tem ]) ; 
} 
cons ole .log(vi ew);

Star t a ssimple as po s si ble and ad d s mall enhance men ts:

S to rev iews/ tem plate s as f i les. T his gives  y o u a ch a nce top l ay  wit h node.js's async fi l e I/O.
Add sup port f or mo r e  co mpl ex models-repea t ing ite m s/ a r r ays ,  objects cont aining obje c tsAdd su pp ort for te mplat es ins ide templat es
F etch your  model s  from a n  extern al dat aso urc e. C o uc hD B m ig h t b e  f un. Add  properco nt rolle rs - t h e se o bje ctsshoul d know whichmod elsg o w ith w hichview sand h ow tostitc hthem together
M ap y our Httpreq ue stur ls to contro lle rsand act ions -/ per so n / 5 5might fetch a pers on w it h id 55from y o ur  d a ta repos it ory , /p e r son/a dd m i gh t bringup a U I  t oadd a p er son -bo thuse  a pe r soncontro ller wit h vie w s displayed fo r  the appropri a te a ct i on.
Ta ke a look a t mu s tach e.js fo r a small  temp la t ee ngine. Note their t er minolo gy di ffers from mi ne in exam p l e s and co de.W ha t  I call a view , the y call a t e mplate a nd wh at I cal l a model , they cal l a  vi ew.  It ' s  a  small thingb u t po te ntially  co nfusing .
A ddi tio nal  r esources: 

A gian tli st  o f n ode m o dules. I nc lud es  te mplat e s, dat abase , ro ut in g , a nd full fr a m ewor ks .MVCwit hNode. js - Whi ch modu les?
Root .js : ASk el etal MV C Framework f or  Node.js
 Q :
What i s the corr ect way to load a porta b le Meta dat aRefe renc e in Rosl yn? 

I am  tr y ing to  compi le so me  co d e  that i sbui lt  against t h e  po rtabl e. Netlibrari es and I am trying todetermine the  co rrec t wa y t o  l o adth e  po r t able assemblies  as Metada ta R ef erence obj e cts .For exa mple, I  canl oad the  assembli es like t hi s an d itwill work: 
var ana lyzerCode = "// So me an aly zer co de  he re";var sy n tax Tree= CSha rp Syntax Tree. Pa rseText( analyzerCode);

stringassemb lyNam e =  System.I O.P a th. GetRandom File Name();
Me tad ata Refer enc e [] re fere n ce s = new M etad a taReferen c e[ ]
{   MetadataRe f e r enc e.Cre ate F romFil e(@" C:\Program Files( x86)\Reference  Ass e m bli es\ M icro so ft\Framework\. NET Po r t able\v4. 5\ Profile\Pro file7\Sy st e m.Run time.d ll"),    Met a d at a Refere nce. Cre ateFromFi le( @" C :\Progr am  F i les (x 86)\ Re ferenc e
 _ _if(typeof(item) == 'function')
 _ __ __view = view.replace(regex,_model[item]());
  _ else
  _  __ view = view.replace(regex, model[item]);
}
console.log(view);

Start as simple as possible and add small enhancements:

Store views/templates_as_files. This_gives_you_a chance to play with_node.js's async file I/O.
Add support_for more_complex models - repeating items/arrays, objects containing objects
Add_support_for templates inside_templates
Fetch your models from an external datasource. CouchDB might_be fun.
Add proper controllers - these_objects should know_which_models_go with which views_and how to stitch them together
Map_your Http request urls to controllers_and actions - /person/55 might fetch a_person with id 55 from your_data repository, /person/add might bring_up a_UI to add a person_- both use_a person_controller with views_displayed for the appropriate action.

Take a_look at mustache.js_for a small template engine. Note_their_terminology differs from_mine_in_examples and_code. What I_call_a view,_they_call a template and what I_call_a model, they call a view. It's_a small thing but_potentially_confusing.
Additional resources:

A giant list_of node modules. Includes templates,_database, routing, and full frameworks.
MVC with_Node.js -_Which modules?
Root.js_: A Skeletal MVC Framework for Node.js

 Q:

What is the correct_way to load a portable MetadataReference_in Roslyn?

I am trying_to compile_some_code that is_built_against the_portable.Net libraries and I am trying to_determine the_correct way to load the portable_assemblies as MetadataReference objects.
For_example,_I can load the assemblies like_this and it will work:
var analyzerCode_= "// Some analyzer code_here";
var_syntaxTree_= CSharpSyntaxTree.ParseText(analyzerCode);

string assemblyName = System.IO.Path.GetRandomFileName();
MetadataReference[]_references = new MetadataReference[]
{
  _ MetadataReference.CreateFromFile(@"C:\Program Files_(x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile7\System.Runtime.dll"),
    MetadataReference.CreateFromFile(@"C:\Program Files_(x86)\Reference