I have migrated 2 DLLs and an aspx page to an existing web application on a production server. The changes in the file do not show up when I run the web application.
I have restarted the web application, restarted the associated application pool, run iisreset, deleted the Temporary ASP.NET Files. The changes do not show.
I have created a new html file in the root of the application, but it returns a 404 File Not Found error.
In IIS, I right-click the web application and choose Explore just to make sure that I am in the correct directory. I am. I see my updated files there. I can view the text of the aspx page, and my changes are there. My test html file is there.
I have searched StackOverflow, implementing all of the prior solutions I have seen that have fixed other poster's questions. Is there anything else I can do to IIS, the file system, or anything else to get these changes to show?
It sounds like you are not hitting the website that you think you are. Check your bindings and host headers, maybe another site on the server is intercepting the request.
Related
I have a long running Net 3.1 Web App using c# with Razor. I recently added a new page .cshtml . On localhost, the new page will appear and operate as expected, however after Web Deploy from Visual Studio, xxxxx.azurewebsites.net , the page in question returns 404. There is no subdirectory, its at wwwroot level.
Reviewing errors in logstream in Azure Portal, it shows the file in question and directory path does not exist. xxx.net:80/newpage
Deployment is to Windows based Webapp service.
You're question is a bit vague. I will try to answer as best as I can.
Assuming the web app is setup properly,
When running locally, if you have the .cshtml file open and in focus, (most of the time and if there is no model where the view is expecting data) Visual Studio will render the html in the browser regardless of anything else.
In the cloud, you need a controller action that is the route to your view. If there is no subdirectory, then your Home controller should do.
Another way in the cloud to render the html apart from everything else is to separate the file as an html file and do some routing and DNS configuration.
Please offer some code example of your specific situation and/or what you have tried so far and I will attempt to help further, if I can.
Someone (not me) developed a web site that hits a web service implemented in C#. When I run the web site in visual studio, the project automatically starts the web service. In the web service, I want to log some information to a file for testing. log4net is used in the webservice project, but nothing is logged. I will admit I do not spend much time dealing with log4net, but the web.config hsa values that look like they should produce a file, and it does not.
So, I tried to dump the text of interest to a text file on my local drive.
File.AppendAllText(logPath, txt + "\n");
There are no errors and nothing is sent to the file.
I start the Website, not the web service, so the debugger seems to not know about the web service (so I can't simply set a break point in the web service).
My expectation is that for security reasons things are started in a way that simply disallow this. I vaguely remember that when started in this way, your services are also not allowed to write to disk, so in a development box while running from visual studio, how can I write a simple file to disk.
It seems to me like this should be simple.
First at all, you should call the web service, to log anything. You could use an external program like fiddler or postman, or write a unit test. After the first call, you could attach the visual studio to the w3wp.exe, so you could debug the problem.
The user of the AppPool should be granted the write permission to the log file.
I want to comment at the above answer,but i have no rights.
To set that user to have write permission, for local develop environment,just right click the log folder ,select properties,under the "security" tab,click "Edit",add "EveryOne" with read,write,modify permissions.
In production environment,you should select the real apppool user instead.
Although the answers were useful, and correct, it is not what solved the issue. Also, related, see this:
log4net doesn't create log file when deployed on IIS7
Remember that I chose to start the WebSite, and that auto-starts the WebService. That problem has NOT been solved, but, a coworker burned some brain cells and he thinks that it has to do with how Visual Studio magically starts the web service and that log4net is NOT initialized. If I start the web service by itself, then logging works as configured. I am still testing to see if the above advice allows a lot to be written to a specific directory.
i have worked on ASP.net Web application in my local host and it worked perfectly, when i move the application folder to the Test server with IIS 8 it worked the first time but every time i modified a page in my local and move it to server i can not see the changes,
when i created ASP.net Web site i dont face any issue with that, can you please provide with the correct way of copy web application to another server?
also i enabled the custom error in webl.config but i am getting another error
any suggestion
thank you
This answer is based on the conversation in comment section.when you are publishing your website you will get three options
Allow this precompiled site to be updatable:Leaving it checked allows you to make certain changes to the .Aspx files after it has been deployed without recompiling (ex = move the position of a control or add some additional HTML markup).
use fixed naming and single page assemblies:Fixed named assemblies provide flexiblity in page level updates. Since each page will have its own named assembly (instead of a random name) it is easy to update the application by just updating the required assembly.that said if you have made changes to single code behind file then you can easily replace particular .dll file on server with your changed .dll file and the site will work.
Disadvantage is the large number of assemblies (difficult to maintain) and also slight performance hit would be there.
enable strong naming on precompiled assemblies:This is primarily for higher security
For more information check this link
I am trying to deploy my first ASP.NET application on a server running IIS 7. But I always get an error 404 when trying to open the page. I thought it might be a start page issue, so I entered a direct URL to a .aspx file inside the wwwroot folder, but that got me another 404. Next step was to set a start page in the IIS Manager to a certain .aspx file, which made the page open, but the URL shown didn't include the specific page, and I didn't see my bootstrap navbar (just links that should be inside it) nor my Infragistics components. (To give context, we just upgraded the server to .NET 4.5 this morning, but all other ASP.NET websites in the same or other application pools still work perfectly!).
I then enabled the option to see folder contents in the browser; opening the website then showed me all the files that were supposedly not found, but clicking on them gave me 404 again. For testing purposes I put a .html inside the main folder: that one I could click and open, as well as *.css files or images in subfolders. But as I said above: ASP.NET is installed and working for all the other websites. I checked the MIME things, there is nothing for ASP related files, but neither is there in the working projects. The handler mappings seem to be correct as well.
So what could the reason for this be? I am totally unacquainted with IIS, so I lack any ideas beyond simple googling :/ My guess would be something permission-related (the app pool it's currently in is using pipeline mode: classic; but again, the same as the working stuff) or another dynamic content option I missed. Or - since as soon as I manually define a start page to be one of the .aspx files, I see at least something - it could be related to extensionless URL's? When I manually enter
myservername\myappname\StartPage.aspx
the browser at least shows
myservername\myappname\StartPage
instead. But I can't seem to find an option to change this. Any help is greatly appreciated!
I ran into this issue when I first started working with ASP.NET. I spent hours scratching my head trying to figure out what was the problem. After a fair bit of research this is what solved my problem. I added the flowing code in the web.config file.
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"></modules>
</system.webServer>
Is it possible in ASP.NET MVC to display a downtime page when publishing a project out to a server?
Right now, if I hit the page while I am publishing I get an error:
Could not load type "App.MvcApplication"
It would be awesome if we could setup a downtime page so that users know to come back at a later time, instead of thinking that the app is busted.
You could add an app_offline.htm page to your application root, traffic will be redirected to that page until you remove or rename it.
More info
Scott Gu's App_Offline.htm
App_Offline.htm and working around the "IE Friendly Errors" feature
Will app_offline.htm stop current requests or just new requests?
An alternative to doing this in the application is to have IIS sort this out for you.
Application Initialization Module gives this feature, and also allows you to run warm-up scripts.