1

我有一个包含多个 Web 项目的解决方案。

我已将每个项目构建到自己的文件夹中(大约有 10 个项目):

/build/projA
/build/projB
/build/projC

如果我打电话

aspnet_compiler -v / -p \"build/#{proj}\" merged/#{proj}

反过来,一切都很好。

如果我同时进行所有 10 次调用aspnet_compiler,我会收到程序集加载错误,说明引用的程序集正在使用中。

这是一个错误吗?为什么会被使用?不应该。

无法加载的程序集位于多个项目中,但每个项目的 bin 文件夹中都有自己的副本。

更新:似乎(对于某些)作为引用的引用的程序集。那些加载了完整绑定信息的似乎可以工作。

这是来自其中一个失败加载的转储fuslogvw

The operation failed.
Bind result: hr = 0x80070020. The process cannot access the file because it is being used by another process.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: User = andrew.bullock
LOG: DisplayName = Yahoo.Yui.Compressor
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Yahoo.Yui.Compressor | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///E:/build/ProjA/
LOG: Initial PrivatePath = E:\build\ProjA\bin
LOG: Dynamic Base = C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\src_projects_proja\061ad2e7
LOG: Cache Base = C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\src_projects_proja\061ad2e7
LOG: AppName = 627cc9a9
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: E:\build\ProjA\web.config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/src_projects_proja/061ad2e7/627cc9a9/Yahoo.Yui.Compressor.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/src_projects_proja/061ad2e7/627cc9a9/Yahoo.Yui.Compressor/Yahoo.Yui.Compressor.DLL.
LOG: Attempting download of new URL file:///E:/build/ProjA/bin/Yahoo.Yui.Compressor.DLL.
LOG: Assembly download was successful. Attempting setup of file: E:\build\ProjA\bin\Yahoo.Yui.Compressor.dll
LOG: Entering download cache setup phase.
ERR: Error extracting manifest import from file (hr = 0x80070020).
ERR: Setup failed with hr = 0x80070020.
ERR: Failed to complete setup of assembly (hr = 0x80070020). Probing terminated.
4

1 回答 1

0

如果你ClientBuildManager直接打电话,外面aspnet_compiler似乎没有问题,不知道为什么。

var parameter = new ClientBuildManagerParameter
    {
        PrecompilationFlags = PrecompilationFlags.ForceDebug
    };
var client = new ClientBuildManager("/", src, dest, parameter);
client.PrecompileApplication();
于 2012-04-23T08:10:10.260 回答