I have a razor pages project that until recently worked fine, and on a colleagues computer works fine. On mine however, when running from Visual Studio or publishing to Azure via Visual studio it returns 404 for every page. Everything works as expected if I bypass Visual Studio and use dotnet run instead. Interestingly, previous commits that worked fine for me also now have the same problem. Which leads me to think its something environmental, but I can't track the cause down.
I also faced the same issue .
Try to use dotnet build instead of dotnet run.
Also check you map the path in azure configuration for your application in the azure app service
Related
I am trying to deploy my blazor WebAssembly project to IIS localhost. However, it does not load in the browser with the following errors:
So far I have tried to resolve this issue by setting "PublishTrimmed" to false. This did not resolve my issue. I have seen other people online have a similar problem and recommended the fix just mentioned (which did not resolve the issue for me). Thanks.
The fix for me was to delete the bin and obj folders in, both, the server and client projects with "PublishTrimmed" set to false in the csproj of the server project. Then use dotnet publish -o "location" -c release in powershell (in the server project directory) to publish to the target location set in IIS. Now everything works as expected.
I am trying to publish my site to a local folder so I can upload it to Github Pages. I first created the site as a Blazor Server app and that worked without errors. I then made this into a Blazor webassembly and am now getting this error:
Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(614, 5): [MSB6006] "C:\Program Files\dotnet" exited with code 1.
I have tried using Visual Studio, Jetbrains Rider and command prompt and all of them have returned the same error. I have tried with PWA enabled and disabled but nothing has worked. Can someone help?
There is a bug in the last asp.net core which prevents projects from building if they are located in a folder with spaces (Program Files in your case).
Can you try moving the project to another folder (for example C:) and try again?
I've been using ASP.NET Core 5.0 for a project and running it via docker-compose inside VS2017 Community.
Previously when I ran the project it would connect to a port automatically published by Visual Studio and load the web application (see image 1). However, similarly to another project, it simply refuses connection when debugging starts (see image 2).
Even when manually publishing the ports via the ports: portion of the docker-compose.yml file it still refuses connection.
After trying to find a solution to no avail, I've turned to asking here. I've tried all of the following:
Restarting Visual Studio
Deleting the .vs folder and restarting.
Restarting computer.
Exposing ports 80 and 443 explicitly in docker-compose.yml
Checking out to previous, known working commits.
As mentioned before this behavior has also started occurring on a university assignment which is running ASP.NET Core 3.1, which I prefer to have working before it's due.
I did Clean/Purge Data on Docker Desktop for Windows, restarted and it seems to be working now. I really wish I knew what actually causes this problem so I can avoid in in the future....
I am developing a web app (web service) using Visual Studio 2015 net core v1 und hosting it on an Windows Server 2012 R2 with iis.
It is running well, but the changes I make are not being used.
In visual studio I save the changes and go to the publish section and publish it. I take the publish output folder and replace the original folder with it.
But it seems like it is not changing anything because I still get the old answers.
I tried restarting the website, but it did not change anything.
EDIT:
if I debug it, it works perfect
Like Ankesh Kumar mentioned: selecting an other output folder solver this problem.
I am new to mongoDB. I would like to ask for help about deployment of a C# .net app with MongoDB. I tried to publish it but when I run, it goes not working. I know the error is that I need to manually run mongod.exe through C:/mongodb/bin/mongod. But how can I setup it without manually run the mongod.exe? Your help is highly appreciated. Thank you :)
You should understand that your .NET application and Mongo database are different parts of the system. They even can be placed on different machines. So, publish of your application shouldn't affect availability of database.
However you can combine these two actions in one simple batch file:
msbuild.exe [your app with necessary options]
C:/mongodb/bin/mongod.exe [options]
On how to build and deploy web-apps via msbuild you can see here:
How to Publish Web with msbuild?
Invoke a publish from msbuild for visual studio 2012
Invoke a publish from msbuild for visual studio 2012
You probably want to set up mongodb to run as a windows service, rather than manually starting the server on demand.
Instructions can be found here:
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/