Some changes doesn't work on IIS - c#

I created a web site with .NET 4.0 . I published it to my server's IIS. My web site is working. But after publish when i tried to add new forms they work on Visual Studio's localhost but doesn't work on IIS . For example I create etik.aspx . It works on Visual Studio but when I deploy it to IIS It gives me this error.
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 'BerksanWebSite.berknet.etik'.
Something else I add a change to my master page. It shows front changes (on aspx file) but changes in aspx.cs file doesn't work . I don't understand why it is not working. Can anybody help me?

Start from searching similar topics with same message
Parser Error when deploy ASP.NET application
Try to push back your changes and find which one cause error.
May be find a video tutorial. Try again for empty project and simple form.

I solved this problem with uploading new bin files to server. Thanks #Eldar

Related

Manually deploying a simple ASP.NET Web Application (in a subfolder on port 81!)

I can not believe I have to ask this, but here I am!
Here is all I have done:
Visual Studio 2013 - Create New ASP.NET Web Application (Empty).
Saved it as MyWebApp.
Once the project was created, I right-clicked and added a new item: Web Form
Saved it as index.aspx
In the designer, added a button.
Created a Click event for this button that looks like:
protected void Button1_Click(object sender, EventArgs e)
{
string myStringVariable = "foo";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable + "');", true);
}
Done. That's it. Can't get any simpler.
So then I built it. And published it using Visual Studio 2013. I chose the Publish method of File System and a local location of C:\inetpub\wwwroot.
Now, I did this locally, in my VM, just to see what files it would place. And as I thought, in wwwroot:
It created a bin folder and placed MyWebApp.dll in this folder.
It placed a web.config
It placed index.aspx.
So, now, let's go to my actual real web server! I mean, I can place static html files there right now, and view them from my browser. It works!
So I go to the default website (c:\inetpub\wwwroot), created a folder called ASP, and placed those files in it (index.aspx, web.config, bin folder with dll).
When I run it using (I'm on the server): http://localhost/ASP/index.aspx I continually get this parser error:
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: The file '/ASP/index.aspx.cs' does not exist.
Source Error:
Line 1: <%# Page Language="C#" AutoEventWireup="true"
CodeFile="index.aspx.cs" Inherits="MyWebApp.index" %> Line 2: Line
3:
Source File: /ASP/index.aspx Line: 1
Version Information: Microsoft .NET Framework Version:4.0.30319;
ASP.NET Version:4.6.1086.0
(I have switched between CodeFile and CodeBehind - based on some googling here, neither works).
No matter what I do, I can't get index.aspx to "find/see" index.aspx.cs that's inside the dll. Is there some configuration step I'm missing? I just don't get it.
Thanks.
EDIT: To be clear, I believe it's because I put it in a subfolder. It seems to work if I put those same files just in wwwroot, instead of the subfolder. I just added that to the title, because as soon as I pressed submit on this question - I realized, maybe it's because it's in this subfolder! Isn't that the way this always works? Ask for help, and the process of writing it up gives you clarity? :)
EDIT: Arrgh! The other tid-bit of info I left out was that I was trying this on Port 81. I had created a 2nd Site (IIS) and binded it to port 81 (and yes I'm including that in my URL). And I was playing around there. And I had even thought to make it an Application (the subfolder). But it just doesn't work there. Only under my Default Web Site. I must be missing some type of configuration information.

Asp publish website with Sqlite

first of all I'm a total newbie with Asp.net. On the other hand I use C# everyday.
So what I have to do is a fairly easy matter except for the fact that I don't know Asp.Net.
I am require to make a simple form that gathers data in a Sqlite database.
I am using VS2008 and the latest version of Sqlite.
Everything works fine when working locally (I can run the website and add data to the s3db db).
The problems are coming out when it comes to publishing. At the moment I am publishing ON MY FILE SYSTEM accordin to procedure Walkthrough: Deploying a Web Site Project by Using the Publish Web Site Tool
so when it comes to the paragraph Testing the published Website (published in the folder C:\CompiledWebSite so the local address is http://localhost/CompiledSite/Default.aspx) I get the error:
Server Error in '/CompiledSite' Application.
Could not load file or assembly 'System.Data.SQLite' or one of its dependencies. An attempt was made to load a program with an incorrect format.
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.BadImageFormatException: Could not load file or assembly 'System.Data.SQLite' or one of its dependencies. An attempt was made to load a program with an incorrect format.
which I didn't get when running it from VS2008.
So all what comes to my mind is that it's not a matter of Sqlite format but a problem related to the fact that it doesn't find the .s3db file which in the end there isn't in the folder C:\CompiledSite.
But I added it to the solution! And I can see it in the solution explorer structure.
I think that all problems come from my being totally unaware of how asp works but I have to find a solution!
can anybody help me?
thanx in advance!
I found it!!!
from
http://www.codeproject.com/Articles/548421/Anplusattemptpluswasplusmadeplustoplusloadplusaplu
it says to go to IIS and set Application Pools --> Advanced Settings --> Set "Enabled 32-Bit Application" to True and press OK
that worked!!

Copying mini website into main website giving configuration error

Recently,
I developed one mini site and had to deploy that site in one of our main project.
What I did is, I copied the whole mini project and pasted into the main project. And when I tried running the mini project, I got error as
*It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.*
Also, the error was generated from my mini web.config file from the line no : 45. Where the code was
<profile defaultProvider="DefaultProfileProvider">
I don't know what was the error all about. I also tried searching on the net for the issue and I got one link from here but it also didn't helped me out.
Please suggest something which can be of any help. Also let me know know If I have to make some changes.
Try using the System.Diagnostics.Process.Start("Link of your website.com");
or please try iframe.
The error is very specific as to what the problem is. You need to configure the virtual directory your "mini site" is in as an application in IIS.
Open up Internet Information Services Manager, expand the list of sites until you find your "mini site". Right click on it and choose "Convert to Application". Problem solved.
It sounds as though you need to mount the mini site as an application. What version of IIS are you using? The following steps for IIS 7 may help:
Creating a Web Application (Virtual Directory) in IIS 7
In case of link-rot, I'll summarise the points as well:
Open IIS Manager
Right-click on your master site and select "Add Application"
Fill out the resulting dialogue box. The alias is the "subfolder" the app will be mounted within, and the physical path is the directory your "mini site" resides in
Hope that helps.
Finally after researching so much, I got my answer.
What I need to do is(My mistake)
Converted the Web.Config file of the mini site as Convert to Application.
After that I got error as Excel03ConString already exist. For that, I commented out that line from the mini site.
Next, When I browsed the site I got error as: The Site needs default document as it was giving Membership page which comes by default.
SO I selected the default page and it started working smoothly.

asp.net page display only html tags in localhost?

asp.net page display only html tags When I want to show in my localhost. I have created a asp.net website project in vs 2010. And move the Published files to C:\wamp\www\CRS for localhost. But asp.net page display only html tags. see the Image.
This is a website project not web application. So I can't Build the package and Import to IIS. Pls help me.
Edit 1-
When I move All files to C:\inetpub\wwwroot\crs and access in localhost,.. It gives Configuration Error.
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
What I miss?
You should use IIS to run ASP.net.
It seems you are using Apache. If you REALLY want to use Apache you need to install mono : run asp.net on apache
Otherwise setup a new website in IIS and point to your directory.
as #basarat give a way to solve this question.
1) Copy and paste the Published website files in C:\inetpub\wwwroot
2) In IIS right Cilck the Default website and Add Application property. It opens the Add Application window.
3) Give the name in Alias Field, then Give a Correct path of project.
4) Then you can access the asp.net page in localhost
check the content type that the page is served with it has to be "text/html" instead of what you have

Parser error 'Could not load type'

I am getting a parser error when I try to access this page
http://mosab2a.elkedeseen.org/reyady/
but locally it's working well
Check the version in the web server vs the one you build against
Try Re-Publishing your Site again correctly. Make sure to Re-build your site before publishing it. Follow all the steps correctly that are used to publish a site. Make sure you have the required .Net Framework installed in your server machine. Also try changing "CodeBehind" to "CodeFile" on your Line1
Check this link (Could not load type 'site._Default') as well

Categories

Resources