0
我想使用MSBuild編譯我的ASP.NET MVC3應用程序。由於DLL的不需要Main
方法,我已經指定的目標是一個圖書館,爲什麼編譯器拋出以下異常:MSBuild說我需要一個庫編譯的主要方法
CSC : error CS5001: Program 'c:\MvcApplication1\web\bin\MvcApplication1.dll' does not contain a static 'Main' method suitable for an entry point[C:\MvcApplication1\web\MvcApplication1.csproj]
這裏的.csproj的文件:
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OutputType>Library</OutputType>
<AssemblyName>MvcApplication1</AssemblyName>
<OutputPath>bin\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="*.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="..\lib\*.dll" />
</ItemGroup>
<Target Name="Build">
<MakeDir Directories="$(OutputPath)" Condition="!Exists('$(OutputPath)')" />
<Csc References="@(Reference)" Sources="@(Compile)" OutputAssembly="$(OutputPath)$(AssemblyName).dll" />
<Copy SourceFiles="@(Reference)" DestinationFolder="$(OutputPath)" />
</Target>
</Project>
是的,我想我在我的.csproj文件中設置了`/ target:library` csc switch' Library `。 –
nbsp
2011-12-14 00:24:59