Publishing single page from ASP.NET Core project - asp.net-core

I have an ASP.NET Core project using Razor pages,
I published the project from Visual studio 2019 to an Azure web app,
Its working fine.
But when I doing a change in a single page, I want to publish the only modified page to the project,
I'm doing this from : Project menu----> Publish page.cshtml, Visual studio is telling me the file has published successfully, but I do not see any change in the online page.
Is there is any missing step after publishing the page?
Kindly help me regarding this issue.

#ZanestMahmood,
Good morning. Could you please visit https://websiteName.scm.azurewebsites.net and verify that your changes exist. If the latest files exist, then could you please try to stop and start the web app. Please refer to the URL for additional information. https://github.com/projectkudu/kudu/wiki/Kudu-console

Related

could not run the ASP.NET Core MVC application

when i run the ASP.NET Core MVC application from Visual studio 2022, it getting conflicts with source and module file(please refer the attached image.)
We are migrating MVC5 project to ASP.NET Core MVC and i dont know these initial configuration settings
Pls assist me on this
Thanks
I need to run the application in the browser.
Please delete the bin folder and rebuild your project.

.NET Core MVC app not updating View unless entire project is published

I have a .NET Core MVC app hosted in IIS (development) as well as Azure App Service (production).
When I make a simple HTML change to a Razor View and publish just that view, it does not get updated.
It only gets updated if I publish the entire project.
This happens in both IIS and Azure app service.
Is this the default behavior or am I doing something wrong?
Here is the configuration page from Azure App Service:
When you publish the complete program to iis, iis compiles and runs it. .net core mvc disables runtime compilation by default, so even if the view is updated and released, the program that is already running will not compile the new view.
If you want iis to use the new view after the VS update and release the view, you can add a line of code to the startup to enable the function of compiling and running.
Add Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation Nuget package to the project.
Add following code in startup.cs:
services.AddRazorPages().AddRazorRuntimeCompilation();
Publish entire project.
After all of these, once you update view and publish. IIS will display new view.
Here is my test result.
You don't need to do any operations on the portal.
The article provided by Lex Li talks about the content of Razor when compiling. Simply put, C# server code can be written in the .cshtml file. After compilation, it will become projectname.Views.dll, so when you modify When the .cshtml file is not sure which projects it is associated with, it is recommended to update it globally to avoid bugs caused by version issues.
Regarding your current problem of partial update, it is also easy to solve. First, you need to define the file or folder inclusion options when compiling. You need read offical document first.
Below screenshot is my test project.
After my modification and settings, you can publish your customized files or folders to the azure production environment. (The code setting part is for reference only, coding according to specific projects)
In the post, you said that you want to publish an html file, then you can right-click the file or folder and select publish file or folder.
Right click test folder.
From the screenshot message below, we can see that the partial update was successful, the speed is very fast, the modified content is also prompted, and the global update is not performed.
prompt:
The above steps are all tested and passed, and the answers and code parts given are for reference only.
If you encounter problems during the operation, it is recommended to raise a support ticket on the portal.

I cant find MVC 5 template on vs2017 community

please i have a issue; two issues as a matter of fact. I will upload screen shots to better explain my ordeal.
I am new to MVC and intend to start using MVC 5. the tutorial i have works with MVC5.
I have installed vs2017 community. When i star a new project, i find the "ASP.NET Web Application" template. which i select. after giving my project a name and selecting .NET framework version, the development frameworks that shows up for MVC, WEB FORMS, WEB API all have '4' on them (meaning version 4?). see attached screen shots
when i select MVC and my project folders are scafolded, in the App_start folder, i do not find the IdentityCOnfig.cs file (see attached screen shot)
can anyone please help me with how i can rectify this? i really do not know what is going on and need your help
thanks identityConfig.cs missing
MVC template showing '4'
Need choose User accounts I attached a Image

Asp.net Core application is not running with VS 2017?

I have installed the visual studio 2017 for ASP.Net Core. I created Dot Net Core project. Build it successfully and run it but on Firefox it shows the blank page and on chrome it shows "**The localhost page isn’t working
localhost is currently unable to handle this request"
I thought there is a problem in code. I debugged the code and there is nothing wrong with the code. It's the default template and code generated for Asp.Net Core. I googled and tried many things like restart the VS, removed cache, etc but nothing worked for me. Then i uninstalled the VS 2017 and used C Cleaner to remove all temp files etc and installed the visual studio 2017 again but the same error came again. Then i created MVC application, console application in VS 2017 and both worked fine. Issue comes only in Asp.net core application. I use fiddler to see the request status and it is 500. I debugged the code but nothing wrong with the code(No Exception). I have tried many things but did not find anything helpful. Can anyone tell me what's the issue?
The blank page response can be caused by a number of reasons. Sometimes because you are lacking something in the system , routing issues, wrong code on the wrong location, .csproj configuration issues, permission issues, and many more.
There are a couple of things you can try:
Check to see if you have the appropriate ASP.NET Core Module installed in you system. (Either x86 or x64 depending on your system )
Make sure you have enabled IIS Integration in your code
See if you have the error middleware in your Configure code, it mostly helps to solve your issues by giving full detail.
Looks like you are running into error similar to this issue with browserlink .What version of browser link package do you have in your machine
Microsoft.VisualStudio.Web.BrowserLink should be 1.0.1 referring the templates
This SO post discuss the similar issue .If that does not solve, Please make sure you have 1.0.1 in your project referenced and then try this
Clearing your NuGet cache
dotnet nuget locals all --clear
Set Environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE to 1 . This is to avoid caching packages
dotnet restore
Does it happens to be runtime compilation issues?
I stumble across this issues log while studying the feasibility of using ASP.Net Core for ERP System host on LinuxOS.
Issues #2017 on GitHub
Try setting
<PreserveCompilationContext>false<PreserveCompilationContext>
in your csproj

Visual Studio won't show my installed project templates

I'm trying to install some custom made project templates for asp.net MVC4, however my Visual Studio 2012 Premium won't show the new templates. The templates are installed by a .VISX file like this one: http://www.asp.net/single-page-application/overview/templates/hottowel-template
Visual Studio is showing this file as an "Enabled" and "Installed" Extension, but when I try to create a new ASP.NET MVC4 project it is not showing those templates as an option like shown in this image:
I'm just seeing the regular options and it is not showing me the Hot-Towel template or any other single page application template. Could you please tell me how to fix this if one of you guys knows.
I fixed this by installing ASP.Net Web Tools Update Pack Fall 2012:
http://www.asp.net/vnext
I decided to give the answer to my own question for helping others with the same question.