Blazor WebAssembly publish failed - visual-studio

I'm trying to publish a Blazor WebAssembly App, targeting .NET 5.0.
I created a new Web Deploy publish profile from Visual Studio 2019, using the default settings:
The site is published to IIS, but the browser is displaying a 500.19 - Internal Server Error: "The requested page cannot be accessed because the related configuration data for the page is invalid."
There's a strange path for web.config, which is starting with "\\?\":
\\?\C:\inetpub\wwwroot\__ClientBlazor\web.config
I've tried any of the suggestions I've found on similar threads, but none of them solve the problem.
Could it be a specific bug of VS publish wizard on Blazor projects?

Turns out that it was an url-rewrite problem, which is addressed by this IIS Url Rewrite extension.
Simply install the extension and the republish the app, it will work.
BUT other errors will then be raised, like the following:
404 on every css and javascript resources (see this and that for further details and a really weird solution).

Related

Azure Web Site not updating via Visual Studio Web Deploy

This may be a basic question, but I've searched for a little while and couldn't find anything specific to this.
I bought a domain and created the web app in Azure for hosting, and set up the DNS so that it's linked to the Azure Web App. Using Visual Studio 15, I opened the website via the FTP connection settings found in Azure, and was able to create files, edit the html, css, etc. Going forward, I wanted to use Web Deploy with Visual Studio to push new builds of the code up to the web site. I downloaded the publish profile from Azure, and imported it into a new visual studio project. I also copied all the previous files over(it wasn't alot). I got the correct Web Deploy settings and successfully published the solution to the Web App in Azure. However, it never updates the code with my new changes. When I look at the site in Firebug it still has the same files/code that it had when I edited it via FTP.
Any idea what I'm doing wrong?
I followed your steps and everything published perfectly for me. Did you try to simply refresh the file list to make sure Visual Studio is seeing all your files? Are they included in your project?
Also, when you go to publish, on the 4th step labeled preview, try to hit "start preview" and see if it detects any changes.
Also, could you tell me a bit more about your project? Is it a website project folder, mvc solution, etc?
You could try to clean the website to make sure your new files are getting deployed.
Clean Windows Azure Website

Visual Studio keeps requesting missing web components

When I open a particular mvc 3 website project in VS 2010 I get the following message:
The Web Project "X" requires missing web components to run with Visual Studio. Would you like to download and install them using the Web Platform Installer now?
ASP.NET Web pages with Razor syntax.
When I click yes
The web platform installer shows with the message that "0" items need to be installed.
My other mvc 3 projects do not show this behavior
Not a major inconvenience, but still...
thoughts any one?
I got the same error after reinstalling my computer.
I came to this conclusion, VS needs IISExpress to load my additional project. The addition projects has a webservice and it can run locally. Even if my endpoints points to a local address it still needs the IISExpress (standard IIS 7.5 does not respond the endpoint request) to open from VS (im running VS2010).
So after installing IISExpress i could reload my project in VS.
C.,
That shouldn't happen, and it would be interesting to figure out why. In the meantime, you should be able to turn this off by unchecking the "Package Restore" checkbox in Visual Studio's Options dialog. (Select "Package Manager" in the tree view to find it.)
If it's happening only for specific projects, you can solve this more surgically by removing the packages.config file for the affected project. In fact, if you want to do root cause analysis, you should look into why that file exists and how it got there.
HTH,
Clay

Debugging an existing sharepoint solution

I've recently mapped a sharepoint solution from TFS to a local directory and successfully 'got' the latest version.
It wasn't building, but this was because of there were no Site URL's in the properties of the several projects included in the solution. So, using central admin, I created a new web app (the port 36352). U then added the url and port to the Site Url and it's now building fine.
However, when I go to run with the debugger I get the following two errors:
Error 2 Error occurred in deployment step 'Recycle IIS Application Pool': Cannot connect to the SharePoint site: :36352/">http://:36352/ (deleted url for security reasons). Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project.
AND
Error 3 Program 'Path.PowerShell.exe' (deleted path for security reasons) does not contain a static 'Main' method suitable for an entry point
It seems that the first error is related to the way in which I've 'connected' it to the new web app I've created - have I done this part right?
The 2nd error seems to be with regard to the entry point at which the debugger should execute, but this is a sharepoint site - so I just want to run the site (has VS not identified this as sharepoint somehow?).
Thanks a LOT for any help.
I got this exception when I had the solution on a different server. Make sure your solution is on the same server as the SharePoint web application. When you run the solution, Visual studio packages the solution and tries to deploy it onto the URL you specified in the properties. If your project is a farm solutions such as visual web part then make sure you have rights to deploy.

How to configure a published package as a website in IIS

I want to auto publish the sites using teamcity. I am using teamcity's Visual studio to publish a website. It creates a pre-compiled web directory as following
D:\publish\PrecompiledWeb\Books in the checkout directory.
Now I need to use it with IIS. If I point the IIS to that directory It gives the following error
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Any Idea what I am doing wrong.
I'm not entirely clear on the steps you're taking from your question, but it looks like your ultimate goal is to use TeamCity to create a deployable package and publish that to IIS. Your best bet is to do this using WebDeploy and fire it off from a Visual Studio build runner in TeamCity with appropriate parameters. There's a step-by-step guide to doing this in the You're deploying it wrong series.

How to disable "Validating Web Site" step when building an ASP.NET Web Site project?

Sometimes, I want to skip validation of the web site to save time when I build an ASP.NET Web Site project. Is there a Visual Studio option or any other means to turn off this behaviour?
Re: How do I turn off 'validating web
pages'. May 21, 2008 02:52 AM
Hi,
Validating Web Site is important. It
does the following tasks:
Validate web.config to make sure that
all settings are legal. Validate aspx
page's markup. List error in the Error
List. If you don't want to validate,
you can set your project to "No Build"
or "Build Page" before running startup
page.
For more information, please refer to
http://forums.asp.net/t/939998.aspx.
I hope this helps.
Thomas Sun Microsoft Online Community
Support
-- http://forums.asp.net/t/1262277.aspx
Website project, Property Pages (in VS 2010):
Some of the earlier service packs had issues with Validating taking a while (days in some cases). Check and see if you can update Visual Studio and seem if that resolves the issue.

Resources