Where can I see the files for a Azure static web app? Image file doesn't seem to have been deployed - azure

I'm playing around with Azure Static Web Apps and have built a simple Blazor App which I've deployed. I added a Contacts page with an image that appears when built and running in Visual Studio but the image is missing when the app is is deployed via a GitHub Workflow Action. I've checked the file is present in the GitHub repo. I'm just using the free version of Azure static web apps for testing and believe the files are deployed to blob storage.
I can see two similar related questions to my problem but neither of them provide a solution to my issue
Is there a way to view files in Azure Static Web App?
Azure static web apps not loading page resources correctly. css or javascript files
As per the link to the first question above, is there a way to see the files deployed to check if the file is actually there? Everything I'm seeing tells me it's not! - the image is not showing and copying the link to a new window gives me the usual file not found. Link looks absolutely spot on - https://madeupbit.azurestaticapps.net/FundXWebTelNo1.png. I deliberately moved the file out of a separate images directory into the root to eliminate any of the possible issues mentioned in the second question linked above.
And I guess the second question is if it's not there, how do I get it there seeing the automated GitHub Workflow Action ain't doing it. Of course there may be something else going on so any suggestions welcome!

Related

Visual Studio ClickOnce Web Deployment

I would be most grateful if anyone could help me solve this problem with ClickOnce Web deployment.
I have read all the threads on this subject and I have also read through all the Microsoft documentation on the subject. They seem to say a lot without actually being direct or providing helpful examples. However, perhaps I am wrong and I have not looked in the right places.
I have already used ClickOnce successfully to deploy an application on the local area network.
It works well and really isn't that complicated. However, my goal is to deploy this application to customers, who are not connected to my local network.
I have set up a web site (www.mydomain.co.za), which I can access directly or via the ftp protocol.
I have created a sub directory off the root where I intend to publish the files created by the publish function. The publish function of the application requires a Publishing Folder Location and a Installation Folder URL I don't really understand the functional difference between these two locations. If I set the Publishing Location to ftp://www.mydomain.co.za/MyProductName and the Installation Folder URL to http://www.mydomain.co.za/MyProductName, then the publish process succeeds and when I check on the web server, the files have been published successfully it would seem. A further Application Files/MyProductName subdiectory with the version number information appended was created where all the output was placed.
My next step is to then grab the URL of the setup.exe file and to run it from a browser. This downloads the setup.exe file to my downloads folder which I then try to run but I get an error
Deployment and application do not have matching security zones.>
I have seen this come up in other threads but These threads don't seem to relate directly to what I am trying to do. These threads make mention of using Internet Explorer to achieve some degree of success, but all the browser did was to download the file.
I have also noted with interest that a web page is created in the root with a button that prompts the user to install the application. This does not work either.
Does anyone know of an article that I can read on this subject which is more helpful or if anyone can offer more insights into this I would be very grateful.

Object removed from assembly still referred to after deploy to Azure, local is fine

ASP.NET Core 2.1
We have a shared dll, that is used in a few projects (via project reference)
We have class in that was named Proofer, and is now named ProofReader.
This was done through mass find and replace.
Nowhere in our source files locally exists any files containing the text Proofer.
VSTS builds the application without issue, then we send it via a release pipeline to Azure. All succeed.
Despite this we attempt to run the web app and get the following:
An unhandled exception occurred while processing the request.
TypeLoadException: Could not load type
'MainShared.Models.Proofer' from assembly 'MainShared,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule
pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob,
Int32* pcNamedArgs)
We are having trouble determining if this is in the build, maybe something not being rebuilt when it should be, or something still cached on Azure that isn't being overwritten.
A few places I can suggest you look into -
If you are using app service web apps in azure , we can use the kudu (web app extension to remove/clean the files) to make sure you have a clean destination.
Check the VSTS Release logs if you have access to , it shows the files which are overwritten and the ones which could not be. Once i had a similar issue and found that the logs were already warning me that a few could not be overwritten.
If you are using VM's for your app deployment if has access to it , remove/backup the files under your site folder.
I had a similar problem after some redesign for a Web App using ASP.NET Core 2.2 (hosted on Azure), that some old not even anymore existing references causing the Load type exceptions to happen and the Web App simply refused to come up. I tried to clean everything up in Visual Studio, even deleted the bin and object directories, but the old reference was still looked for. In Kudu on the Azure portal I saw the *.PrecompiledViews.dll and *.PrecompiledViews.pdb files, which were very old. I simply removed them directly on the Azure server and could then simply start up my app and everything came up again. This fault should be fixed from the source. If I do a complete rebuild, I expect this old garbage to be taken care of during the publishing to the website. This is something that Microsoft should fix and as I can see this happened to others over half a year ago. Thanks Mark Johnson for your very useful hint about those files!

Publish Azure WebJob including all items from bin-folder

I'm trying to publish my WebJob which is connected to an Azure Website. So I use Publish on the website. This will publish the site and inside the App_Data-Folder the files for the WebJob are deployed.
The problem is, that I use the NuGet package Microsoft.SqlServer.Types inside the WebJob which brings 2 dlls one of which is a C++ native lib. This dll lays in "/bin/SqlServerTypes" of my WebJob-bin-folder which wouldn't be deployed by the publish-operation. Only items directly laying inside of the bin-Folder of the WebJob are deployed.
How can I ensure, that the complete bin-folder from the WebJob-project is deployed to App_Data on the web?
What I tried so far is:
Adding a project-reference to the WebJob-project in the WebSite-project.
Generating the folder-structure under App_Data in VS and referencing the dll there.
Edit: Turns out, that I had a simple spelling bug when creating the structure beneath the App_Data-Folder. In my case it worked when I just added those dlls in the folder the tooling expected them to be. See the answers for other good links.
I had a similar issue. Check this out.
As far as I know, this hasn't been solved yet. A workaround is to copy the relevant dependencies via FTP.
Hope this helps.

Style (.css) missing when added Azure Cloud Project

I'm in my way to convert an existing web site to Azure Cloud Service Project, but when I add this cloud project and debug my the project, the web page is missing all the styling, i.e. all the tabs in one page. I have seen that doesn't take the .css
Someone could tell me what's happening here?
Thanks!
Verify the *.css files, you need to make sure that the Build Action is set to Content:
You can try changing the properties of the cloud project -> Web -> use IIS Web Server..
worked for me
I had the same problem and I found it came from my use of IIS Express.
The problem was an error that can be seen in Windows Application Logs:
Src: IIS Express
"The directory specified for caching compressed content [...] is invalid. Static compression is being disabled."
fist I don't know if I have to write this as answer, if not sorry, I'll correct it.
About my question, I tough in publish it to Azure and when i did it, was working correctly. What I still don't know is why when I debug in VS with the cloud project is missing style and images.

How to publish MSHTHML.dll and SHDOCVW.dll to Azure

I have a 3rd party web page screen capture DLL from http://websitesscreenshot.com/ that lets me target a URL and save the page to a image file. I've moved this code into my Azure-based project and when I run it on my local sandboxed dev box and save to the Azure blob, everything is fine. But when I push the bits to my live server on Azure, it's failing.
I think this is because either MSHTML.dll and/or SHDOCVW.dll are missing from my Azure configuration.
How can I get these libraries (plus any dependent binaries) up to Azure?
I found the following advice on an MSFT forum but haven't tried it yet. http://social.msdn.microsoft.com/Forums/en-US/windowsazuredevelopment/thread/0344dcff-6fdd-4479-a3b4-3e89750a92f4/
Hello, I haven't tried mshtml in the cloud. But generally speaking, to
use a native dll in a Web Role, you add the dll to the Web Role
project just like adding a picture (choose add existing items). Then
make sure the Build Action is set to Content. This tells Visual Studio
to copy the dll file to the output package.
Also check dependencies carefully. A lot of problems related to native
code are caused by missing dependencies, such as a particular VC++
runtime dll.
Thought I'd ask here first before I burn a day or two on an unproven solution.
EDIT #1:
it turns out that our problem was not related to MSHTML.dll or SHDOCVW.dll missing from the Azure server. They're there.
The issue is that by default new server instance have the IE security hardening feature enabled, and this was preventing our 3rd party dll from executing script. So we needed to turn off the enhanced IE security configuration settings. This is also a non-trivial exercise.
In the meantime, we just created a server-side version of the feature on our site we need to make screen captures from (e.g. we eliminated JSON-based rendering of UI on the client), and we were able to proceed.
I think the solution mentioned in the MSDN forum thread is correct. You should put them as part of your project files, so that the SDK will package and deploy them to the VM on the cloud.
But if they are COM and need to be registed you'd better call the register command via the Startup feature. Please check http://msdn.microsoft.com/en-us/hh351539
HTH

Resources