Showing posts with label .Net Core. Show all posts
Showing posts with label .Net Core. Show all posts

Wednesday, October 18, 2017

VS 2017 MVC Core 2.0 error - Cannot find reference assembly 'Microsoft.AspNetCore.Mvc.Razor.ViewCompilation-x86.exe' file for package Microsoft.AspNetCore.Mvc.Razor.ViewCompilation-x86

Scenario

After compiling a MVC Core 2.0 project in VS 2017, the browser isn't displaying the site

Error
An unhandled exception occurred while processing the request.

Cannot find reference assembly 'Microsoft.AspNetCore.Mvc.Razor.ViewCompilation-x86.exe' file for package Microsoft.AspNetCore.Mvc.Razor.ViewCompilation-x86

Solution
Open the .csproj file in a text editor
In the section set the MvcRazorCompileOnPublish tag as true:
      <mvcrazorcompileonpublish>true</mvcrazorcompileonpublish>

Tuesday, October 17, 2017

VS 2017 MVC Core 2.0 publish fails

Scenario
Publish a MVC Core 2.0 project in Visual Studio 2017

Error
Severity
Error
Code
The command ""bin\Release\net461\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation-x86.exe"
Description
@"obj\Release\net461\microsoft.aspnetcore.mvc.razor.viewcompilation.rsp"" exited with code 1


Solution
Open the .csproj file in a text editor
In the section set the MvcRazorCompileOnPublish tag as false:
      <mvcrazorcompileonpublish>false</mvcrazorcompileonpublish>

Friday, June 16, 2017

MVC Core error - HTTP Error 502.5 - Process Failure

If you are deploying your project to Internet Information Services and you get the error below, there are several possible reasons according with microsoft.


Possible reasons:
  • If you published a self-contained application, confirm that you didn’t set a platform in buildOptions of project.json that conflicts with the publishing RID. For example, do not specify a platform of x86 and publish with an RID of win81-x64 (dotnet publish -c Release -r win81-x64). The project will publish without warning or error but fail with the above logged exceptions on the server.
  • Check the processPath attribute on the element in web.config to confirm that it is dotnet for a portable application or .\my_application.exe for a self-contained application. For a portable application, dotnet.exe might not be accessible via the PATH settings. Confirm that C:\Program Files\dotnet\ exists in the System PATH settings.
  • For a portable application, dotnet.exe might not be accessible for the user identity of the Application Pool. Confirm that the AppPool user identity has access to the C:\Program Files\dotnet directory. Confirm that you have correctly referenced the IIS Integration middleware by calling the .UseIISIntegration() method of the application’s WebHostBuilder().
  • If you are using the .UseUrls() extension method when self-hosting with Kestrel, confirm that it is positioned before the .UseIISIntegration() extension method on WebHostBuilder(). .UseIISIntegration() must set the Url for the reverse-proxy when running Kestrel behind IIS and not have its value overridden by .UseUrls().
I got this error, but in my case the problem was I didn't declared the environment variable ASPNETCORE_ENVIRONMENT, so the application wasn't able to get the appsettings..json file; after I added the variable I restarted the server and my site worked just fine.

Monday, June 12, 2017

ASP MVC Error Unable to connect to web server IIS Express

If you get the next error when trying to run your app from visual studio:


You can try different things to fix the problem

- Right click on your project, then select properties, click on the Debug section, assign a new port in the App URL direction



- In explorer go to the path \.vs\config and delete the applicationhost.config, then rebuild your project 



- Open the task manager and stop the IIS Express if is running so you can get a fresh instance


Wednesday, June 7, 2017

.Net Core Installation Error 0x80070003 - The system cannot find the path specified

If you are trying to install .Net Core on your server and you get the error:

.Net Core 1.0.1 VS 2015 Tooling Preview 2 - Installation Error 0x80070003 - The system cannot find the path specified.



That only means the install packages are not complete so we have to completed the installation; to do it follow the next steps:

- Open the command line

- Run the .Net Core installation file with the layout parameter from the command like


- You should get the confirmation message that .Net Core was successfully installed