简体   繁体   中英

Visual Studio When publish some class is missing from DLL

I have a solution containing a website, with lots of files.

It recently happened that a new webpage had to be added to the site. When building the solution with the new files, everything works. When trying to use the Web Publishing Wizard, the process breaks up.

Basically, this is what happens:

  • new page (eg myPage) added to the webproject
  • build locally in visual studio, everything is all right. Final assembly has all the classes included in code base.
  • publish the website to filesystem (right click and Publish from CSProject), precompilation throws error saying that class "myPage" is missing.

I've checked the Dll version (eg myWebSite.dll) in the three usual locations:

  • \\bin -> compiled code is complete, including "MyPage" class
  • \\obj\\Debug\\Package\\PackageTmp\\bin -> compiled code is NOT complete, new classes are MISSING including "MyPage" class
  • \\obj\\Debug\\AspnetCompileMerge\\Source\\bin -> compiled code is NOT complete, new classes are MISSING including "MyPage" class

Solution is designed like so, with circular references:

MySolution
    Project A
    Project B
    Project C
    ...

Project A references Project B, which references assembly output from Project A .

When building locally, everything worked because the assembly generated from A was ProjectA.dll and was regenerated. It looks like when using "publish" from within visual studio (Web Publishing, not TFS build and publish feature) it messes up with references and the resulting Dll is missing of some parts.

This defect is caused because the referenced circular assembly was not the latest one, but an outdated one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM