App_GlobalResources资源未编译到bin / App_GlobalResources.dll中

时间:2012-04-20 11:24:05

标签: asp.net resources

我是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中。 有什么问题?

1 个答案:

答案 0 :(得分:0)

我明白了。问题是Eazfuscator。为了解决这个错误,我将资源从我的业务层dll移到了一个没有混淆的单独的dll。