0

My (C# Asp.net) website works locally, but when I publish it to Azure, it is missing a dll (OpenXML SDK).

After extensive googling, I found that I should set the Copy Local property to True. The thing is though, there is no references node in my solution explorer. Even if I create a new project, and add a few references, there is no references node there. (MS Visual Studio Express 2013 for Web)

Solution Explorer

Here is the error:

Parser Error Message: Could not load file or assembly [...] The system cannot find the file specified.

The error is caused by this line (in my Web.config file):

<add assembly="DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

Please help me to either:

  • display the references node
  • or manually upload the needed dll (feels odd)
  • or add some magic command to my Web.config to make it automatically upload the used dll-s.
vacip
  • 5,246
  • 2
  • 26
  • 54
  • Possible duplicate of [Equivalent of reference 'Copy Local' in ASP.NET Web Site project](http://stackoverflow.com/questions/4278452/equivalent-of-reference-copy-local-in-asp-net-web-site-project) – mathewc Jan 10 '16 at 16:49
  • @mathewc Thank you for pointing me to that question, but it didn't solve my problem. I found the problem and the solution, I'll post it in a bit. I might edit my answer a bit, and hope it will be helpful to others in my shoes. – vacip Jan 10 '16 at 17:34

1 Answers1

1

The references node was missing from my Solution Explorer because I chose to create a Web Site, not a Web Application. For Web Sites, the actual physical folder structure is what gets synced to the server. It doesn't have a References node (and, by the looks of it, many other things are missing, since the basic idea is bit different - see this discussion for more details).

There were two solutions for the problem:

  • Converting my Web Site project into a Web Application project (instructions here)
  • Adding a Bin folder in my project folder (that is the folder with the project name, the on that has my .aspx files in it), and including the necessary dll in that folder

I chose the latter. After publishing the site again, Visual Studio automatically uploaded the Bin folder with the dll inside it, and it worked like a charm.

Community
  • 1
  • 1
vacip
  • 5,246
  • 2
  • 26
  • 54