Reputation: 4662
I have created an upload program that I'd like to sell but not give the source code out. I have published this on my web server and had no problems.
I compiled it and went to the bin directory and copied the contents to another folder on my web server. Tried to access it and got this:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'AspxUpload.Default'.
Source Error:
Line 1: <%@ Page Language="C#" AutoEventWireup="true" Inherits="AspxUpload.Default" Codebehind="Default.aspx.cs" %>
Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Source File: /u/default.aspx Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1016
I'm rather new to asp.net, but I know what an application pool is. Can a program written in asp.net not be copied directly to the server and be expected to run?
I was testing what I was going to place in a zip file as a test but this will not run 'out of the box'.
What am I doing wrong or what am I missing?
UPDATE
Just for clarification, I'd like to be able to copy the contents of my zip into a directory and have it work without having to create an application pool, if that is feasible. Like I was saying, I was hoping to make this an 'out of the box' solution.
Is this possible with Asp.net?
====== UPDATE #2 ======
I found out that, in IIS, if I right click on the folder where the app is and convert to an Application, it works fine.
Do all asp.net apps need to be converted to an application if not published?
I have also updated the error message from the server where the website resides.
Upvotes: 1
Views: 176
Reputation: 1223
From what you're saying you might be trying to add an application within your application pool. If you publish your entire application to a folder, then zip it, you should be able to publish the contents of that folder to any web hosting (folder) that is configured as an asp.net application.
So when talking of out of the box software, in most cases when someone takes out web hosting for asp.net it will come configured as an application on the root directory. If this is where the file is unzipped to then it should work fine but if they use a subfolder within the root, then this may need to be converted to a web application.
In my experience some hosting companies will only allow a certain amount of configured web apps, and in a lot of cases only one, so this is worth considering if they app needs to be added under another directory.
Upvotes: 1
Reputation: 161831
Depending on the version of Visual Studio you have, you can use the "Publish" command. Have the application published to a package, which is a .zip file which can be imported by IIS 7 and above (at least, if you have the Web Deploy feature installed).
Publishing can not only save the application, but also IIS configuration if you're using IIS locally for your web application, and you can even deploy a database.
In addition, you can use web.config transforms to vary the web.config based on the build configuration. So that, if your publishing settings are for your "Test" build configuration, the package will contain the result of building with the "Test" configuration, as well as the result of applying "Web.test.config" to "Web.config" to produce a Web.config modified for your Test environment.
Upvotes: 0
Reputation: 1223
I don't know why you would need to move the folder but first check that your web.config is in the root and that it has the appropriate access rights.
Then check any other folders for other web.config files or do a search for it in the application.
It sounds like an issue with either a duplicate web.config or that is missing.
Upvotes: 0
Reputation: 1924
Please have a look at this post to get around your issue.
http://blogs.msdn.com/b/robgruen/archive/2005/09/12/464196.aspx
Upvotes: 0