0

我是 ASP.NET 的新手。使用 msbuild + msdeploy 部署 Web 应用程序时出现错误。

System.IO.FileNotFoundException: Could not load file or assembly 'App_GlobalResources' or one of its dependencies. The system cannot find the file specified.

=== Pre-bind state information ===
LOG: User = NT AUTHORITY\NETWORK SERVICE
LOG: DisplayName = App_GlobalResources
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: App_GlobalResources | 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:///C:/inetpub/wwwroot/MyServiceApp/
LOG: Initial PrivatePath = C:\inetpub\wwwroot\MyServiceApp\bin
Calling assembly : MyServiceApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\inetpub\wwwroot\MyServiceApp\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet.config
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/MyServiceApp/b220778e/cc04677/App_GlobalResources.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/MyServiceApp/b220778e/cc04677/App_GlobalResources/App_GlobalResources.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyServiceApp/bin/App_GlobalResources.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyServiceApp/bin/App_GlobalResources/App_GlobalResources.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/MyServiceApp/b220778e/cc04677/App_GlobalResources.EXE.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/MyServiceApp/b220778e/cc04677/App_GlobalResources/App_GlobalResources.EXE.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyServiceApp/bin/App_GlobalResources.EXE.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyServiceApp/bin/App_GlobalResources/App_GlobalResources.EXE.

我的 msbuild 任务:

  <Target Name="Build">
    <MSBuild Projects="$(ProjectFilePath)"
      Targets="Package"
      Properties="OutDir=$(BuildDir)\;Configuration=$(Configuration);Platform=$(Platform);PackageLocation=$(WebPackageDir)\$(WebSiteName).zip"/>
  </Target>
...
  <Target Name="MsDeploy">
    <Exec Command="$(WebPackageDir)\$(WebSiteName).deploy.cmd /Y /m:http://$(DeployServer)/MSDeployAgentService /U:$(DeployServerUser) /P:$(DeployServerPsw)" 
          ContinueOnError="false" />
  </Target>

bin目录包含en/MyServiceApp.resources.dll、de/MyServiceApp.resources.dll等。为什么web服务器要搜索文件App_GlobalResources.dll?MyServiceApp.App_GlobalResources.Xxx.xx.resources 文件出现在 obj 文件夹中,但 App_GlobalResources 未编译到 bin/App_GlobalResources.dll 中。怎么了?

4

1 回答 1

0

我想到了。问题是Eazfuscator。为了修复这个错误,我将资源从业务层 dll 移到了一个单独的未混淆的 dll 中。

于 2012-06-15T09:03:20.087 回答