开发者

NAnt error using solution task to compile .Net framework 3.5 project: Error MSB4127, Error MSB4060

开发者 https://www.devze.com 2023-04-13 03:25 出处:网络
I run into the error, listed below, when executing a NAnt task that would compile a .Net 3.5 project-with CC.Net:

I run into the error, listed below, when executing a NAnt task that would compile a .Net 3.5 project- with CC.Net:

[solution] C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Data.Entity.targets(40,5): Error MSB4127: The "EntityDeploy" task could not be instantiated from the assembly "C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Data.Entity.Build.Tasks.dll". Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly as the one installed on your computer and that your host application is not missing a binding redirect for Microsoft.Build.Framework. Unable to cast object of type 'Microsoft.Data.Entity.Build.Tasks.EntityDeploy' to type 'Microsoft.Build.Framework.ITask'.
 [solution] C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Data.Entity.targets(40,5): Error MSB4060: The "EntityDeploy" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name.
 [solution] Project 'CAPS.UnitTests.NETVersion3' failed!
 [solution] Continuing build with non-dependent projects.

I quick research points to tha fact that I would need an assembly reference in my app.config file as: The references in my project has a "Runtime Version" attribute value of v2.0.50727

<configuration>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
                <bindingR开发者_运维技巧edirect oldVersion="0.0.0.0-99.9.9.9" newVersion="3.5.0.0"/>
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>

However the error still persists in my case.

Cheers.


From NAnt documentation for the <solution> task:

Right now, only Microsoft Visual Studio .NET 2002 and 2003 solutions and projects are supported. Support for .NET Compact Framework projects is also not available at this time.

Currently there seems to be work in progress with NAnt 0.91 Release Candidate 1. Anyway I would advise to build solutions via MSBuild call from NAnt. You can do this by using either NAnt's <exec> task or NAntContrib's <msbuild> task. Find more information here, here, and here.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号