Search code examples
.netasp.netasp.net-development-serv

ASP.NET app deployment mess


I have a little mess with a web application. I works in the development environment, and now I'm trying to publish it to another folder still in my own computer, so one of my colleages could try it without bother me. So I went to "Publish" in "Visual Studio", created a new "Web Application", and then I published the application there.

But the app doesn't work:

Could not load file or assembly 'DkWP2' or one of its dependencies. The system cannot find the file specified. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

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

I've given a look at folder structure and the files are there, but it's a little bit awkward:

C:\inetpub\wwwroot\DkWP2App>tree /f
Folder PATH listing
Volume serial number is 68B7-8AE3
C:.
│   AppConfig.xml
│   LogoMini.png
│   DkPService.svc
│   Web.config
│
├───App_Data
├───bin
│   │   AppConfig.xml
│   │   DkWP2.dll
│   │   DkWP2.pdb
│   │   DkWP2.XmlSerializers.dll
│   │
│   ├───css
│   │   └───GSA1
│   │       │   jquery-ui-1.8.5.custom.css
│   │       │
│   │       └───Images
│   │               [jQueryUi Pictures]
│   │
│   ├───Images
│   │       [Some of the Main pictures]
│   │
│   └───x86
│       └───Debug
│               AppConfig.xml
│               DkWP2.dll
│               DkWP2.pdb
│
├───css
│   │   [MainCss Files]
│   │
│   ├───Base
│   │       [Base Css Files]
│   │
│   └───GSA1
│       │   jquery-ui-1.8.5.custom.css
│       │
│       └───Images
│           [jQueryUi Pictures]
│
├───Images
│       [Main pictures]
│
├───JavaScript
│       [JS Files]
│
├───Web
└───Web References
  • The .dll files in ./bin and ./bin/x86/Debug have different sizes.
  • I've tried to copy the .dll files to ./ but it still doesn't work.
  • The folder css appears in ./ and ./bin, but with different content.

Where is ASP.NET trying to locate the .dll files at?

Why do I have a ./bin/x86/Debug if I selected "Release" when I published?

Kind regards.


Solution

  • When you publish next time, open the Output window set to the Build output. This will be full of instructions that Visual Studio is outputting to show you all that it is doing. When I had a DLL reference missing, I found statements in there where Visual Studio was trying to find the file that was missing. It noted all the places that it looked to find the file.