Errors when running Apps in ASP.NET MVC CORE - visual-studio

I am recently set up Visual Studio 2017, but
When i try to start ASP.NET MVC CORE Project that runtime error appears:
System.MissingMethodException occurred
HResult=0x80131513
Message=Method not found: 'System.IServiceProvider Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(Microsoft.Extensions.DependencyInjection.IServiceCollection)'.
Source=
StackTrace:
at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
at WebApplication4.Program.Main(String[] args) in C:\Users\qqq\documents\visual studio 2017\Projects\WebApplication4\WebApplication4\Program.cs:line 14
and when i try to run another ASP.NET MVC CORE Project this error message appears:
Unable to start process C:\Program Files\dotnet\dotnet.exe. The web server request failed with status code 500, Internal Server Error. The full response has been written to C:\Users\qqq\AppData\Local\Temp\HttpFailure_04-02-08.html.
Are these errors because of IIS Error or something in configuration ?

Related

Blazor app not running server code when on hosted server

I have a blazor web assembly app and I have 3 projects that were created. The client, server and shared. I assume all of these are deployed as standard when using the webdeploy?
The site works in that it displays the pages etc. However when I go to a page that contacts the server project via the Http.PostAsJsonAsync() method, I get the blazor error page (which I setup to say "oops").
Obviously I get no details as to what is going wrong. So I have no idea what is happening. Is the server app compiled into the Web assembly app? If so why would it not be running the server code? Plus I suppose the other question is how do I get it to report the error so that I can get an idea as to what is going wrong?
It works absolutely fine when running it through Visual Studio.
This is the first time I have deployed to a hosted server so there is a very high chance I have done something wrong...
The method I am calling literally does nothing other than returning a 200 message. So I assume the issue is with calling the server method itself.
Firstly, use Logging:
https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/logging?view=aspnetcore-5.0&pivots=server
#inject ILogger<MyComponent> Logger
Then wrap your Http.PostAsJsonAsync() call in a Try Catch block.
Log the error in the Catch block:
try
{
await Http.PostAsJsonAsync()
}
catch (Exception e)
{
Logger.LogError(e);
}
After deployment, edit your web.config file:
<aspNetCore processPath="dotnet"
arguments=".\Hospitillity.App.Server.dll"
stdoutLogEnabled="true" // <<< MAKE THIS true
stdoutLogFile=".\logs\stdout"
hostingModel="inprocess">
Note, the setting stdoutLogEnabled="true". This will cause your hosting provider to generate log files.
Then recycle your app pool on your hosting provider.
Connect to your website again, and after the error you should have some more details about error logged in
\logs\stdout_nnnnnnnnnnnnnn_nnnnnn.log
on the hosting server.
Take it from there ...

What are these Error Msg from Asp.net core 2.0 WebApi and Krestrel

I created an aspnet Core 2.0 WebApi Code First (work with SQL Server 2017 Database). I have successfully deployed it to Local IIS in my PC.
This is the error msg when I did a GET with Postman :
Error: 0 - Unexpected exception in FrameConnection.ProcessRequestsAsync.
Error: 0 - UbReadCb
Error: 0 - Unexpected exception in FrameConnection.ProcessRequestsAsync.
Error: 0 - Unexpected exception in FrameConnection.ProcessRequestsAsync.
Error: 0 - UbReadCb
I dont know what they mean. Can you help.
Thanks
Got the same errors in log, postman shows "The application process started but failed to listen on the configured port" error when I call API methods.
Googled it and found this thread:
ASP.NET Core 1.0 on IIS error 502.5
I'm going to update ASPNetCore and NetCore runtimes and iisreset after.
Hope it helps.

deploying .ashx files in iis server throws object not set to instance error

After deployment of asp.net website, the button click that calls a generic handler file throws the following error.
Null reference exception: Object not set to instance.

Classic ASP error '800a01b6' Object doesn't support this property or method

I have an error that I cannot resolve, the server is showing this
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'SharedSession'
/includes/minicart.asp, line 183
In minicart.asp we have the following code:
(180)dim SharedSession
(181)set SharedSession = Server.CreateObject("SessionMgr.Session2")
(183)dim miniCartXML: miniCartXML = "" & SharedSession("minicart")
For some reason when the client clears their browsing history the error goes away but it will eventually come back again.... ??
The server is Windows 2008 r2 64bit. The app is running in IIS7 with 32bit enabled.

Error in creating users in ASP.NET Web application after it was converted from a Web Site project

We used this MSDN article to convert our ASP.NET Internet web site that was developed using Visual Studio 2010. The application uses form authentication and it is an external website (not IntrAnet). The application uses SQL Membership Provider and it has built in 'Register' functionality - for registering users - that came with ASP.NET 2.0.
The membership functionality works fine after the web site project was converted to the Web Application project except for the following procedure where we get an error "type or namespace ProfileCommon could not be found". We did not get this error in the Web site project:
protected void RegisterUser_CreatedUser(object sender, EventArgs e)
{
ProfileCommon p = (ProfileCommon)(ProfileCommon.Create(RegisterUser.UserName, true));
}
Please help. Thanks..Nam
Since it is a Web application Project "WAP", Visual studio will not generate the ProfileCommon Class , and you need to access the properties through GetPropertyValue ...
Refer this link for more information: The Differences in Profile between Web Application Projects (WAP) and website

Resources