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 に答える