Jump to content



Photo

Publishing to IIS looses referenced project code

iis

  • Please log in to reply
2 replies to this topic

#1 +_Alexander

_Alexander

    Neowinian

  • Tech Issues Solved: 1
  • Joined: 21-January 13

Posted 28 February 2013 - 05:28

Got a Web Site in C# (Can't show code)
Well it is more like a Web Service and classes which access MySQL

So I decide to factor out MySQL stuff into a separate project (to be used as a library)

So now I have,
1. A Web Site (Not sure if a Web Site is a Project - it doesn't have a project file???)
2. And a Class Library Project (MySQL static classes mostly)
in my solution.

The Web Site has a project reference to the Class Library Project and it has a dependency it. (Right Click -> Add Reference, and I think you need to right click on the solution to add dependencies and set the build order)
The Class Library Project is set to built first.

So the Web Service (In the Web Site Project) now calls static classes in the Class Library project.

To test this, I open up the Web Service file and press F5 - the whole thing compiles and runs locally in the test environment that VS2010 provides.
So, in the test env, it makes the link between the projects just fine - otherwise classes would be missing.

Now I then click on the Web Site and Publish it. It creates this folder with bunch of files and a lib/ folder which has the compiled dll files (Including one named after the Class Library Project).

And I copy that folder onto the IIS 6 on Win Server 2008, right click - make it an application.
Ok great - now I go to the URL. And it tells me that it cannot find the classes (classes that do NOT exist in the Web Site but in the referenced Project).
The thing is, the .dll (Version 0, for some reason???) that is named after the referenced project is part of the published website.

So I am not sure what I am doing wrong to publish a web site with code that exists in a referenced project in the solution to IIS.
It works just fine when debugging locally outside of the IIS.

Same goes if I transform Web Site to Web Application. Referenced project does not make it to IIS.

I am not the brightest when it comes to IIS - it took me half a day to figure out that (the super descriptive) HTTP Error 503 means that I am using the wrong application pool (Default one does not work for some reason).

And a second question,
For a SQL Connection, you can make that work easily with GridView, ListView, etc.
There is no such luxury when it comes to MySQL - you have to do everything from code?


#2 Kalint

Kalint

    Neowinian Senior

  • Tech Issues Solved: 2
  • Joined: 16-January 07

Posted 01 March 2013 - 00:50

when you run with debug on what does it say?

#3 OP +_Alexander

_Alexander

    Neowinian

  • Tech Issues Solved: 1
  • Joined: 21-January 13

Posted 01 March 2013 - 03:16

Turns out I had to enabled 32bit support in the pool on IIS.

Additionally, I had to set the referenced MySQL library reference to 'copy'

*Not exact wording

Edited by _Alexander, 01 March 2013 - 03:18.




Click here to login or here to register to remove this ad, it's free!