Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you convert a C# Class Library project to a Silverlight Project?

I accidentally created a C# class library instead of a Silverlight Class Library for quite a few dlls. Is it possible to modify the project file easily to convert it instead of creating a new one?

like image 234
NotDan Avatar asked Mar 28 '09 21:03

NotDan


1 Answers

Having done this, IMO the easiest thing is to just start afresh. It doesn't take long to copy over a few .cs files and add a few references etc. If you really want you could do a comparison on the csproj; the obvious changes are the <ProjectTypeGuids>, <SilverlightApplication>, <ValidateXaml>, <ProductVersion> and <ProjectExtensions>... and probably many of the references... hmmm - yes, just start afresh; it'll be safer!

If you need to support multiple frameworks, you can cheat (to avoid having to maintain 2+ project files) - I do this in protobuf-net - by including:

<Compile Include="..\protobuf-net\**\*.cs" />

Which says "compile all the .cs files at any level under the ..\protobuf-net path".

like image 69
Marc Gravell Avatar answered Nov 01 '22 16:11

Marc Gravell