0

I have a problem with deployment of a Blazor WASM solution created in C#. It works perfectly when running in development, but I cannot get it to run after deployment to the web test server

My question is related to the standard/recommended approach for this. Do I create a website for each (Client and API) and what do I do with the Shared project? If I try to publish it only gives me option to deploy to folder?

I can publish the Client project fine, and it runs the front-end, but it does not connect to the API

I have tried to publish the API to a separate web application and that does not produce any error - but if I try to call the API through Postman it returns an html page telling me that there is a problem with my resource and it cannot be displayed. The API endpoint returns a Json list of objects and works fine when executed in Postman running locally

13
  • The 'Shared' project disappeared a few versions ago. Be clear what version you use and what project template it is based on. Commented May 12 at 14:29
  • A shared project (if you mean a real shared project as opposed to a "normal" project you are just sharing) is not going to be compiled on its own, but rather the code within the project will be incorporated into each assembly that references it and compiled within them. You don't need to do anything with it. Commented May 12 at 23:27
  • Yes, a normal project called "Shared" comprising the objects that are shared between the Client and Server. And yes, this project dll is deployed to both web applications. So I guess I need to find out which resource it cannot find - any suggestions? Commented May 13 at 11:41
  • This is a little confusing because a resource in api-speak can just mean an endpoint or basically something your api returns (an author in a blog api could be called an author resource, or the author endpoint could be called a resource). Commented May 13 at 21:12
  • 1
    Correct. You cannot have two applications on the same IIS using same port. But for now it works and I can accept the solution. Thanks a lot for your assistance @topsail Commented May 15 at 11:55

1 Answer 1

1

This simply turned out to be caused by incorrect .NET packages on the web server, and correction of web server configuration.

Basically:

  • Install the Blazor app and the API on separate "Sites" using each its own port

  • Install the correct .NET framework packages for the API to be able to run

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.