Visual Studio 2010 Publish Web feature not including all DLLs

后端 未结 13 2045
梦毁少年i
梦毁少年i 2021-01-31 07:14

I have an ASP.NET MVC 2 application.

  • Web project contains a reference to SomeProject
  • SomeProject contains references to ExternalAssembly1 and ExternalAs
相关标签:
13条回答
  • 2021-01-31 08:16

    in my case it is quite tricky. Reference to ExternalAssembly2 is not required to Build the project but vital for run-time since we use reflection to configure Unity container. So, I delete the reference - build the project successfully, but get run-time error. If I preserve the reference I can Build and Run the application but I cannot Publish it with ExternalAssembly2 - get run-time exception as well. This is happen because of internal VS2010 assemblies optimization.

    So, what we can do here? 1. Put some unrequired peice of code to use any ExternalAssembly2's class. 2. escape from reflection and use static assemblies linking.

    Hope this helps to smbd.

    0 讨论(0)
提交回复
热议问题