Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Deploying ASP.Net Application on shared server

  • 22-11-2010 3:11pm
    #1
    Registered Users, Registered Users 2 Posts: 5,401 ✭✭✭


    Hi,

    I'm trying to deploy my first ASP.net application on a shared windows hosting package (blacknight).

    It seems like the ASP.net parser can't find my Dll file (TestApp.dll) that has the code in it, and is located in the BIN folder.

    Here's the error:-
    Parser Error Message: Could not load type 'TestApp.Test'.
    Source Error:
    Line 1: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="TestApp.Test" %>


    I tried moving the DLL file out of the bin folder and into the same folder as the aspx file that calls it. I've also tried chaning the permissions of the DLL file too, to see if maybe it wasn't been allowed to execute.

    Anyone any ideas?

    DD


Comments

  • Registered Users, Registered Users 2 Posts: 2,793 ✭✭✭John_Mc


    Hi,

    I'm trying to deploy my first ASP.net application on a shared windows hosting package (blacknight).

    It seems like the ASP.net parser can't find my Dll file (TestApp.dll) that has the code in it, and is located in the BIN folder.

    Here's the error:-
    Parser Error Message: Could not load type 'TestApp.Test'.
    Source Error:
    Line 1: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="TestApp.Test" %>


    I tried moving the DLL file out of the bin folder and into the same folder as the aspx file that calls it. I've also tried chaning the permissions of the DLL file too, to see if maybe it wasn't been allowed to execute.

    Anyone any ideas?

    DD

    Did you use the Publish feature in the IDE? This packs everything and makes it easy to deploy. The DLL will only work if it's in the GAC (which it wont be because it's shared hosting), or the BIN folder so there's no point moving it around.

    Try changing something the web.config in some way as this recycles the app.


  • Moderators, Business & Finance Moderators Posts: 10,611 Mod ✭✭✭✭Jim2007


    Hi,

    I'm trying to deploy my first ASP.net application on a shared windows hosting package (blacknight).

    It seems like the ASP.net parser can't find my Dll file (TestApp.dll) that has the code in it, and is located in the BIN folder.

    Here's the error:-
    Parser Error Message: Could not load type 'TestApp.Test'.
    Source Error:
    Line 1: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="TestApp.Test" %>


    I tried moving the DLL file out of the bin folder and into the same folder as the aspx file that calls it. I've also tried chaning the permissions of the DLL file too, to see if maybe it wasn't been allowed to execute.

    Anyone any ideas?

    DD

    Most often this means that the folder into which you are deploying the application has not been defined as an Asp.net application folder in IIS. Are you sure that the host supports code-behind applications? Some do not and if that is the case you will need to switch to a website rather that a web application in Visual Studio

    Jim


  • Moderators, Society & Culture Moderators Posts: 9,689 Mod ✭✭✭✭stevenmu


    That line 1 directive is telling the parser to look for the C# source file, not a .dll. If you want it to look for a .dll you need a different directive. You should have something like
    <%@ Assembly Name="MyAssembly, Version 1.0.0.0, Culture=Neutral, PublicKeyToken=abcdefgh" %>
    <%@ Page Language="C#" Inherits="MyNamespace.MyClass" %>
    

    That's from memory so maybe not exactly right, also it would wokr for a .dll in the GAC, not sure about one in the BIN folder.

    As above the easiest thing is to use the VS publishing wizard, IIRC it lets you decide if you want to deploy the site as source files (in which case it'll include the .cs files as needed), or a pre-compiled site in which case it'll build and copy the dll, and I think it updates the directives etc for you.


  • Moderators, Science, Health & Environment Moderators Posts: 9,035 Mod ✭✭✭✭mewso


    No the CodeBehind attribute implies compilation as opposed to CodeFile. I don't really understand all the talk of the GAC as in terms of a web application you would rarely if ever deploy your dll. Maybe if it was a component but not a web app.

    It's hard to know what the problem might be when it presumably is compiling without error. Namespace issues, more than one bin folder and so on. Is this c# or vb.net?


  • Registered Users, Registered Users 2 Posts: 5,401 ✭✭✭DublinDilbert


    Hi guys,

    Thanks for the replies, i got it sorted there was a few issues, all sorted now.


  • Advertisement
  • Moderators, Business & Finance Moderators Posts: 10,611 Mod ✭✭✭✭Jim2007


    Hi guys,

    Thanks for the replies, i got it sorted there was a few issues, all sorted now.

    How about sharing the solution??


  • Registered Users, Registered Users 2 Posts: 5,401 ✭✭✭DublinDilbert


    Jim2007 wrote: »
    How about sharing the solution??

    Sorry i was rushing earlier on, didn't have time to respond. Tried lots of things, even tech support at the ISP had a look and couldn't solve it.

    I then done two things, not sure which of them cured it but here's what i did. When i right click on the project in VS2008 i selected "convert to web application". On the ISP I setup the DNS entries for my domain to point to the webspace root (before this I was just using the URL from the shared host, which mapped to the webspace root).

    Not sure which one of them did it, but its been working perfectly ever since.


  • Moderators, Science, Health & Environment Moderators Posts: 9,035 Mod ✭✭✭✭mewso


    Sorry i was rushing earlier on, didn't have time to respond. Tried lots of things, even tech support at the ISP had a look and couldn't solve it.

    I then done two things, not sure which of them cured it but here's what i did. When i right click on the project in VS2008 i selected "convert to web application". On the ISP I setup the DNS entries for my domain to point to the webspace root (before this I was just using the URL from the shared host, which mapped to the webspace root).

    Not sure which one of them did it, but its been working perfectly ever since.

    First one.


Advertisement