Azure Web Deploy "Could not find a part of the path 'D:\home\site\wwwroot\bin\roslyn\csc.exe'." - azure

I've been browsing the web for a couple hours now looking for an answer to my problem. I am trying to deploy a Web API on Azure Web App Service using VS2017. Everything builds and works fine when running locally but once deployed on Azure (through VS2017) I get this error:
D:\home\site\wwwroot\bin\roslyn\csc.exe
My project is an ASP.NET Web Application (Using Azure Web API template) .NET Framework 4.6.1. I use Microsoft.CodeDom.Providers.DotNetCompilerPlatform Version=1.0.6.0
I also made sure that csc.exe is located in:
Visual Studio 2017\Projects\DeviceManagementAPI\DeviceManagementAPI\bin\roslyn

Just had the same problem and it seems it's a known issue with Microsoft.CodeDom.Providers.DotNetCompilerPlatform 1.0.6 and 1.0.7.
Downgrading to 1.0.5 solves the problem.

Upgrading Microsoft.CodeDom.Providers.DotNetCompilerPlatform to 1.08 worked for me

After a while I simply uploaded manually the roslyn file directly into the server through Kudu. It seems to solve the problem but I still don't know why it won't upload automatically.

Same issue might be caused by missing or incorrect relative packages path. If you're changing solution folder structure make sure all imports have proper path's to avoid missing Roslyn files.
Generally suggest to replace auto-generated ../../../packages/... rabit hole with parameter which will point to correct Nuget folder.
<Import Project="$(NugetPackagesPath)\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('$(NugetPackagesPath)\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />

Related

Blazor publish integrity issue

My team is currently working on a new Blazor app and we are facing some strange behavior. We deploy our APP using Azure Dev Ops, but it seems that sometimes things go wrong. If we deploy the same version with the the same pipeline, the issue could be solved...
This is the error we (sometimes) get in every browser chrome, firefox, edge, ...:
admin:1 Failed to find a valid digest in the 'integrity' attribute for resource 'https://domain/_framework/dotnet.timezones.blat' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
This seems to be happening completely random. We have tried everything... like disabling compression, checking IIS settings, clearing cache, ... We also read the complete Microsoft Documentation. Some other guys also had this problem and they have a solution by clearing the obj/ folder. But we never have this issue locally... So this isn't a solution for us.
Does anybody have any idea what could be the problem? Because it seems completely random to us so far.
The app is ASP.NET core hosted and not stand-alone.
Any help would be very much appreciated!
Kind regards,
Evert
I just ran into the exact same problem. My VS solution compiled and ran under VS 2022 no problem. But when I published to my dev or prod web server I got the same message that you encountered. I solved it by clearing the bin, obj, and .config folders in all my projects in the solution. You mentioned that you don't have the problem locally -- neither did I and this still resolved the issue when I deployed. I suspect an older version of a file is getting into the deployment pipeline somewhere. Mine is also a hosted solution under .NET 6.0.2.

500 error when I try to deploy nextjs ssg application with incremental-static-generation

I have NextJS app with SSG. This functionality was added recently and according to it I should do next-export after next-build to get static files. But after appearing in 9.4 of Incremental Static Regeneration I need to keep server on by npm-start command (in my case I use custom server file with next-express functionality). It works good locally and It works good when I get artifact from Azure. But It doesn't work globally when it will be deployed finally. Help please
Through my attempts, I found that it is impossible to install globally or use next in Azure Web App. That is, it cannot be deployed through Github.Deploying using other methods such as FTP cannot run successfully. It should be related to the azure node environment.
But the method provided in this post says that it can be processed by adding web.config. I think it should be useful and helpful to you. Please read it carefully and try it.
You also can read this document, maybe it useful to you.

System.TypeLoadException on Azure App Service

I'm running an asp.net 4.6 app on the app service. Just removed mvc from the site and using url rewrite to run an mvc free angular spa with a webapi.
Now it's asking for a type that was renamed months ago and works in pre mvc removal builds. I don't think it's got something to do with mvc though.
In trying to solve this I've xeroxed my local bin folder onto the server and the error still persists. So some sort of server config?
Has anyone ever experienced this before?
The error means that you are using a type which is not found in your assembly. To troubleshoot this issue, you need to find where you used this type. I suggest you use the Find in files feature provided by Visual Studio by pressing Ctrl+Shift+F. After found the place which used the type, you just need to delete it and rebuild your application.

Missing Documentation for web.config for a Node.js application on Azure Website

I'm running a Node.js server as API for my mobile app on a Windows Azure Website. And I'm having some trouble with it due to the needed web.config - but I couldn't find any really helpful documentation about it. Everything I can find is googling for specific problems on it and with a bit luck I can use the config snippets.
is there any general documentation about the contents the web.config can contain and their meaning?
in the start I had the problem that errors were modified by IIS to a general error. But since it's a REST API I want the HTTP status codes to be returned. I got around that with the <httpErrors existingResponse="PassThrough" /> element, but it doesn't seem to work for every error.
The only documentation I found so far are example configuration files of the iisnode module.
If you see the following error:
web.config not found in project, to create a project to deploy to
Windows Azure you must create a Windows Azure Node.js project.
....you may have created the wrong type of Visual Studio Project. You want a "Windows Azure Node.js Application" not a "Node.js Web Application". The former creates a few extra files that are needed for Azure (Web.cloud.config & Web.config).
You may be able to create a dummy VS project of the correct type and then copy these files into your existing project. Alternatively create a new project of the correct type and copy your source files into the new project.
Create Azure Basic Node.js Express Application

Setting up Umbraco project with nuget in vs 2012 error

I'm trying to set up a development project in vs 2012 with nuget and Umbraco. I am aware of the several recipe's, amongst the better Umbraco for beginners: Setup Umbraco on localhost together with VS 2012 and uSiteBuilder.
When I am using this procedure I install Umbraco with nuget and build it without problems, but when I hit F5 I get the same error continously: "Could not load type Umbraco.Web.UmbracoApplication" which global.asax inherits from!
What is wrong, what am I missing here...? Thanks in advance /Finn
A bit late, but I had the same problem and the reason for that are missing dll's. Referenced libraries weren't copied to bin folder.
It is not the best or easiest way of setting the project up.
Instead of creating a WebForm project, create an empty MVC4 project and then install the Umbraco CMS from NuGet. This way you won't have to remove anything. It will also by default use IIS Express, so there is no need to change the project properties.
You don't even have to use the NuGet console. You can use the package manager and just search for Umbraco.
Well it seems like an unprofessional oversight from my point! I just forgot to give security access to the relevant folders to network service.
You might have to build and clean the solution a couple of times if you get exposed to the YSOD error: "Cannot create/shadow copy 'filename' when that file already exists" when you hit F5! This error might occur if you hit F5 too quickly after a build, in this case asp.net is probably not finished with whatever it has to complete, and the file is locked.
#Digbyswift: I do not agree with you! Whether you set up your project as an MVC or Webforms application, it doesn't matter. What is important though, is that you use empty applications, as if you don't there will probably be some references/dependencies that you have to delete in order to get the application running! And default server will be the vs dev server, which in my opinion is by far the best and easiest to use untill you are ready to deploy your application. I agree thouhg that using the package-manager from visual studio is the easiest way to come around installing Umbraco.
Following these steps and hints you should use no more than a couple of minutes from installing Umbraco untill you have the wellcome screen and is ready to set up db etc...
Cheers Finn...

Resources