What is still missing in my attempt to host a blazor-server app? - blazor-server-side

I've been hitting my head against this wall for days now and to my knowledge I've followed every direction I've found. But I'm still getting a 500 Error when I browse to the URL.
What I've got to work with is a Windows Server 2012 R2 with IIS 8.5. I'm not married to IIS but I'd prefer not to dip into YET another tech just to get this running.
What I've done:
Old-style blazor-server app (with Program / Startup pair) without authentication. Dependencies:
SharpZipLib
LiteDB
published it using dotnet publish -o bin/publish --self-contained -r win7-x64
copied that folder to the server
On the server:
installed urlrewrite2
installed everything under Windows Features Word Wide Web Services and Web Management Tools
restarted
created a new site in IIS
set the application pool to unmanaged
set the physical path to the folder I copied from my dev system
What I haven't done:
Anything regarding Visual Studio as I'm currently forced to contend with Visual Studio Code and none of that applies/is possible here.
Provisional Workaround
running dotnet my.dll --urls http://*:1234 does work to expose the app to the network
the command needed to be run inside the application folder otherwise the app would fail to load the connection string.
I've also had to provision a production database and modify my appsettings.json accordingly
This is workable for now but not having the app "auto start" with the server is unsatisfactory.

Related

VB.NET web application project docker deployment 403 Error(VS 2019)

I am trying to deploy vb.net web application project (.NET Framework) using Docker option of Visual Studio 2019 and have been running into "403 - Forbidden: Access is denied." error.
However, I am able to run the project by using IIS option.
I am new to both VB.Net and Docker. Please let me know if more information is required to answer this question.
IIS Logs ("How do I access Windows eventlog of a Docker container") attached as image here:IIS Logs
I am putting this answer here for any beginner who may struggle with this:
On running from Visual Studio 2019, using "Docker" option, I was getting an IP on the browser with an error "403-Forbidden". However, when I appended the webform.aspx to it, the error resolved.
So Instead of checking output at 172.24.152.32, I was supposed to view the output at 172.24.152.32/webform.aspx or localhost:52345/webform.aspx.
You just need to put a default document into the container. A simple index.html or default.html should do.

Visual Studio 2017 Published web application returns 500 error

I have tried creating a test default net core web application which runs fine with IIS Express on my local machine. When I publish it to the server (Win 2012 R2), it returns a 500 error when I hit the website. Nothing is logged in the Event Log or IIS logs. I've installed the ASP.NET Core Module and restarted the server and still get the error. From what I've read, it's supposed to deploy a testproject.dll and web.config points to that but mine is generating an executable instead and web.config is pointing to that. Everything is in the root of the website as well so I'm not sure what else I can do. I didn't change any code in the test project, just using the default demo app to make sure I can get it running on a server.
Please help!
After a lot of testing, I finally figured out that there was a few error with IIS bindings, and permissions. Now everything is working.

Deploy WCF service to another Sharepoint server

I've created a WCF service in Sharepoint 2013 and it works great on our dev server. However, we now need to push it onto a production server and I can't seem to find any instructions on how to publish to another server.
I followed a tutorial very similar to this one:
http://www.robertseso.com/2013/05/adding-custom-wcf-services-to.html
In development, but it doesn't cover actual deployment. As per this (and other) tutorials, I deployed as a "farm" solution. If I go to "publish" in Visual Studio the option to "Pubish to SharePoint Site (Sandboxed solutions only)" is grayed out.
After a lot of searching around, I was able to piece together an answer. So in case anybody else encounters the same problem:
In Visual Studio, when you go to "Build" and "Publish..." you can "Publish to File System" (the Publish to SharePoint Site being grayed out as noted in the question). What this does is produce a .wsp file that is you packaged install file you need.
Transfer this file to your target SharePoint server and then open SharePoint Management Shell (as administrator). A list of available cmdlets can be found here:
http://technet.microsoft.com/en-us/library/ff678226%28v=office.15%29.aspx
I used:
Add-SPSolution -LiteralPath c:\<path to wsp file>\myservice.wsp
This adds the solution to Sharepoint but doesn't install it. To install you need:
Install-SPSolution -Identity myservice.wsp -GACDeployment
Note, however, that this will give you an error if the Sharepoint Administrator service isn't running (so check in services.msc first)
This add the installation job to a timer to be run at some point. You can check the status with:
GetSPSolution
Which will list all the solutions, or you can pass a name to if you want to only see the one you just installed. This will show you the "Deployed" status of the service. In my case, it was stuck of False and even after several minutes refused to do anything.
In my case, this problem was solved by going back into services and restarting both SharePoint Timer Service and SharePoint Adminstrator after which is magically showed deployed as True.

How can I publish an MVC 4 application on visual studio?

When I try to publish it I get the following error message:
Error 1 Web deployment task failed. (Could not connect to the remote computer ("..*.*"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.)
I dont understand why is it referring me to a remote computer, I've specified the destination URL as my own IP address. And I have web management service checked on windows features.
How do I solve this particular error?
Try to publish to the file system, if this works move the files into you wwwroot, normally c:\inetpub\www.
then go to start and run inetmgr to open iis configuration manager, if you see your folder there right click and convert to application, accept settings then right click / manage / browse and you should see your site or an IIS error that should be easy to debug.
I never use the deploy to IIS feature from VS as it's pants.
Good luck!

Server 2012 IIS site on different drive

I'm trying to get IIS 8 on a brand new Server 2012 up and running to run a .net 4.5 app and I can't get it to work across drives
Error: 500.19
Module
IIS Web Core
Notification
Unknown
Handler
Not yet determined
Error Code
0x80070005
Config Error
Cannot read configuration file due to insufficient permissions
Config File
\\?\D:\callsheet-test\web.config
The current site is just a single file index.html.
If I copy the folder to anywhere on c: like c:\callsheet-test\ or c:\inetpub\callsheet-test it works perfectly once I change the target location in IIS 8 (site > basic settings).
It doesn't matter if there is an web.config file as a complex mvc/webforms app gives the same error.
I have tried copying the file with permissions and even thought the permissions seem to match for all users. I am still getting this error.
I have deleted the partition and and recreated it as a mount point c:\mount and the same issue happens. Copy the files to c:\notamount and they work fine.
This server is running on a VMware server. Windows 2012 x64 Standard.
Based on further investigation of the problem (via link in my comment above), I've found a workaround via here: change the Group Policy value of "Audit Removable Storage" from "Not Configured" to "No Auditing" and reboot. Bizarre I know. This setting is in Windows Settings/Security Settings/Advanced Audit Policy Configuration/System Audit Policies/Object Access.
Even though we're using VMWare and not Hyper-V this workaround still worked for me. Hopefully Microsoft can provide a answer.
I also had the same error and the solution was similar. I had installed Sql Server 2012 on Windows Server 2012 and it was at this time that I noticed IIS worker processes running from the system C: drive were unable to access configuration files on the E: drive. The site could only be loaded when on the C: drive, despite all the necessary NTFS permissions being granted through IIS_IUSRS, IUSR, Users and/or even the specific AppPool itself. This became evident when IIS couldn't access the E: drive even when running the AppPool (.NET 4.5) using an admin account other than the ApplicationPoolIdentity account (IIS APPPOOL.NET v4.5 in this context - verified in procexp.exe). Installing Sql Server 2012 was throwing errors during installation and required enabling auditing for object access among other settings.
Solution:
Run -> secpol.msc
Security Settings -> Local Policies -> Audit Policy
Change "Audit Object Access" policy to "No Auditing"
Hopefully, this background helps ease someone's headache. :-)