Creating a C# Portable Class Library using command

2019-08-19 12:43发布

问题:

I have not found any information on how to do this, or even if it's possible at all.

http://msdn.microsoft.com/en-us/library/e13syb43

does not mention anything about building a portable class library, and

http://msdn.microsoft.com/en-us/library/gg597391.aspx

does not mention anything about a command line interface.

Has anyone else tried to do this and found a solution/found it to be impossible?

回答1:

Building portable libraries via the command-line is possible, you just need to pass the correct framework references. These determine what platforms you will support.

First, is the reason you want to do this via the command-line because you don't have Visual Studio Pro? If so, it gets a little tricky.



回答2:

Normally you would build csproj with MSBuild from command line instead of manually calling csc.exe.

On other hand the project seems to be set of assemblies - you should be able to give correct set of references (may also need to disable default libraries) via csc command line and build by hand.



回答3:

http://msdn.microsoft.com/en-us/library/gg597391.aspx will take you which supporting assemblies can go into your dll, or where it can be deployed.

http://videojugpages.com/pages/610-Microsoft-Visual-C-Express-Setup This link will show you how to create your dlls at the command line. This is pretty straightforward, and the general dll is no different from the portable type, except in where it can be deployed and on what it can depend. Hope this helps.