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?
Related
I am trying to get my Asp.Net Core 3.1 project running from inside Visual Studio on IIS.
I ran through the steps and it seems to run my Swashbuckle Swagger page, but it hits an error on finding the swagger.json file. When I look at the dev tools, I see I got a 404 when trying to load the swagger.json file. The physical path it is trying to load from is:
C:\inetpub\wwwroot\swagger\v1\swagger.json
But my code is not in inetpub, it is in my development folder. What is even more odd, is I tried this on another machine and it works. So it seems like it should be something to do with how IIS is setup.
I checked my IIS Site settings and the physical path is set to my development folder (not inetpub). And when I hit the "Explore" option in IIS it loads my development folder.
I copied swagger.json into C:\inetpub\wwwroot\swagger\v1\ and it worked (though I then encountered other errors).
Why is IIS trying to use inetpub to find the swagger.json file instead of my development folder?
I have a hard requirement from the developer to use a website project instead of a web app project for a .net deployment. I am able to connect and use continuous integration just fine with a web app project, but when using website, it fails to find the compiled files for deployment:
#[debug]check path : D:\a\_tasks\PublishBuildArtifacts_2ff763a7-ce83-4e1f-bc89-
0ae63477cebe\1.142.2\task.json
##[debug]set resource file to: D:\a\_tasks\PublishBuildArtifacts_2ff763a7-ce83-4e1f-bc89-0ae63477cebe\1.142.2\task.json
##[debug]system.culture=en-US
##[debug]PathtoPublish=D:\a\1\a
##[debug]check path : D:\a\1\a
##[debug]ArtifactName=drop
##[debug]ArtifactType=Container
##[debug]system.hostType=build
##[warning]Directory 'D:\a\1\a' is empty. Nothing will be added to build artifact 'drop'.
Looking at the build process, it's compiling a copy of the deployment to the PrecompiledWeb folder instead of the debug folder, which seems to explain why it cannot find the results. Has anyone had luck deploying with a website project or have you run into the issue above?
Azure DevOps Continuous Integration with asp.net website project instead of web application
Since the project is asp.net website, you may need use the website.publishproj file instead of the .sln file when you publish the asp.net website project with MSBuild.
The command line like:
msbuild.exe "<PathToTheFile>\website.publishproj" /p:deployOnBuild=true /p:publishProfile=WebsiteTestDemo /p:VisualStudioVersion=1x.0
With this setting, MSBuild does not create the PrecompiledWeb folder and the publish uses the setting in the profile.
Check my previous thread for some more details.
The website project the publish process is not plumbed into the build
process. For website project since there is no formal build process
there was nothing for us to really extend.
Hope this helps.
I have forked a Visual Studio-made website on github and am trying to open it with JetBrains Rider. It has no .csproj file (but does use a .publishproj file - think this is Azure related). As such Rider finds no projects to run and I can't seem to set up a run configuration for the local web server.
When I run it in VS I can hit F5 and the localhost webserver starts up and servs my browser the pages nicely. Anyone know how to setup the same in Rider for a ASP.NET Web Site ?
Cheers
EDIT: This is the root of the difference I'm seeing - Rider is fine with Web Apps that have .csproj files but can't seem to create run configs without
ASP.NET Web Site or ASP.NET Web Application?
Currently I try to host webAPI to Microsoft Azure and it is showing me this error as below, but when I am running it on localhost, it is not showing this error.
Error in HelpPage_Default
According to your description, since it's working on your local side, I assumed that you could clean your solution and remove all files under your bin folders, then rebuild your solution. When deploying your web application via Visual Studio, check "Remove additional files at destination" under "Settings > File Publish Options" as follows to avoid something residue from older versions of your code.
Also, you could leverage KUDU to compare your deployed web application content with the local version. Delete all files under "D:\home\site\wwwroot" via KUDU, and re-deploy your web application.
I have created a simple MVC3 application in Visual studio 2012. Earlier I was using VS2010. Both are currently Installed on my System.
The Problem is that when I publish and Deploy the application on IIS It doesn't works.
It gives Error Code 0x00000000
I tried with different applications but problem remains the same. Any of the application created in VS2012 is not deploying Successfully. Please Help.
I am adding snapshot of publish and error message.
looks like you are publishing an mvc3 app.
If I remember correct for that version you either have to install mvc on the server or include mvc binaries in your output directory.
There was a menu item for mvc project (right click on a project in solution explorer) to add mvc dependencies to some binpub folder. You should look for that.
oh and here is a Hanselman post on the topic
http://www.hanselman.com/blog/BINDeployingASPNETMVC3WithRazorToAWindowsServerWithoutMVCInstalled.aspx
And another SO question: Why is the _bin_DeployableAssemblies folder specific to web applications?