Access is denied when building Blazor app - .net-core

I managed to get the Blazor tutorial working
https://dotnet.microsoft.com/learn/aspnet/blazor-tutorial/intro
However, after making some modifications there seems to be some problems witch copying a file. I have tried to run powershell as admin but it did not help
PS D:\ragges\programmering\git\dotnet\blazorTest\BlazorApp> dotnet watch run
watch : Started
Building...
C:\Program Files\dotnet\sdk\5.0.400\Microsoft.Common.CurrentVersion.targets(4965,5): error MSB3021: Unable to copy file "D:\ragges\programmering\git\dotnet\blazorTest\BlazorApp\obj\Debug\net5.0\apphost.exe" to "bin\Debug\net5.0\BlazorApp.exe". Access to the path 'D:\ragges\programmering\git\dotnet\blazorTest\BlazorApp\bin\Debug\net5.0\BlazorApp.exe' is denied. [D:\ragges\programmering\git\dotnet\blazorTest\BlazorApp\BlazorApp.csproj]
The build failed. Fix the build errors and run again.
watch : Exited with error code 1
watch : Waiting for a file to change before restarting dotnet...
I managed to create a new app with
dotnet new blazorserver -o BlazorApp2 --no-https
but the old one will not work

Related

Visual Studio App Center fails running a VS prebuild event - how to get this building locally and in App Center?

I have a Xamarin.Forms Visual Studio solution with an Android app.
The Android app project has a prebuild step where I copy the AndroidManifest.xml from a source AndroidManifest as follows:
copy $(ProjectDir)properties\AndroidManifest.$(ConfigurationName).xml $(ProjectDir)properties\AndroidManifest.xml
I just started experimenting with App Center as I would like crash analytics and am also looking at the iOS build stuff too.
Unfortunately I am unable to get the build in App Center to complete as it seems the prebuild event struggles with the copy command. AppCenter build logs:
PreBuildEvent:
copy /Users/runner/runners/2.163.1/work/1/s/CMSApp/CMSApp.Android/mipmap-anydpi-v26-MochaRelease /Users/runner/runners/2.163.1/work/1/s/CMSApp/CMSApp.Android/Resources/mipmap-anydpi-v26
copy /Users/runner/runners/2.163.1/work/1/s/CMSApp/CMSApp.Android/properties/AndroidManifest.MochaRelease.xml /Users/runner/runners/2.163.1/work/1/s/CMSApp/CMSApp.Android/properties/AndroidManifest.xml
/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmp8dc45b165767431886aee200478ea199.exec.cmd: line 2: copy: command not found
/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmp8dc45b165767431886aee200478ea199.exec.cmd: line 3: copy: command not found
/Library/Frameworks/Mono.framework/Versions/6.4.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(1344,5): error MSB3073: The command "copy /Users/runner/runners/2.163.1/work/1/s/CMSApp/CMSApp.Android/mipmap-anydpi-v26-MochaRelease /Users/runner/runners/2.163.1/work/1/s/CMSApp/CMSApp.Android/Resources/mipmap-anydpi-v26 [/Users/runner/runners/2.163.1/work/1/s/CMSApp/CMSApp.Android/CMSApp.Android.csproj]
/Library/Frameworks/Mono.framework/Versions/6.4.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(1344,5): error MSB3073: copy /Users/runner/runners/2.163.1/work/1/s/CMSApp/CMSApp.Android/properties/AndroidManifest.MochaRelease.xml /Users/runner/runners/2.163.1/work/1/s/CMSApp/CMSApp.Android/properties/AndroidManifest.xml" exited with code 127. [/Users/runner/runners/2.163.1/work/1/s/CMSApp/CMSApp.Android/CMSApp.Android.csproj]
Done Building Project "/Users/runner/runners/2.163.1/work/1/s/CMSApp/CMSApp.Android/CMSApp.Android.csproj" (PackageForAndroid target(s)) -- FAILED.
I did notice after some research that App Center has its own method of doing prebuild events: https://learn.microsoft.com/en-us/appcenter/build/custom/scripts/
But I would like to be able to use VS simple pre/post build events for local builds.
What would be the best approach to getting things working in both App Center and locally short term?

Run protractor through angular-cli without internet

I need to run angular-cli e2e tests (ng e2e) on an offline development system (client restriction). However, an error occurs when Protractor tries to download chromedriver because of the connectivity issue. To manually copy the required files, I ran the command on an online system and then transferred the downloaded files from protractor node_module folder (protractor\node_modules\webdriver-manager\selenium\chromedriver_2.33 and a few other folders) to the offline system. The tests ran successfully a few times. However, the same error started again that the 'ng e2e' command causes to run webdriver-manager update although the driver file is there.
Below error appears on the console:
Error: getaddrinfo EAI_AGAIN chromedriver.storage.googleapis.com:443
Is there an option to turn off 'webdriver-manager update' and use a local copy of the required files?
Thanks for your help
There is a flag that you can add to your ng command
ng e2e --webdriver-update=false

System.Text.Encoding.CodePages missing in netcoreapp2.0 app

I just installed a clean install of the new .NET Core SDK on a CentOs 7 box. I had a different Linux VM I was running to test this and received the same error there.
I am building my application in VS 2017 on a Windows box and copying the project file over to the Linux box to test it. I am coming from netframework environment and trying to learn dotnetcore so I am sure this is probably just a newb issue. Here is what I am doing.
I run a dotnet restore, which works without error.
I run a dotnet build, which I receive a
Build succeeded.
0 Warning(s)
0 Error(s)
Then I run a dotnet run and receive the following error:
Error:
An assembly specified in the application dependencies manifest (apf-ws.deps.json) was not found:
package: 'System.Text.Encoding.CodePages', version: '4.3.0'
path: 'runtimes/unix/lib/netstandard1.3/System.Text.Encoding.CodePages.dll'
Nowhere in my code do I actually reference any type of Encoding explicitly. I have tried including System.Text.Encoding.CodePages in my project to see if that would add a reference and bring in the library to ignore the one it is looking for, but it doesn't help. Anyone have any ideas of what would be causing this?
I tried several things before wiping the directory out in Linux and copying the files over again. In doing so it seemed to fix the problem.

Unable to build the Asp.Net 5 web app on Mac

I installed all the packages and tools from get.asp.net on new Mac.
When I create a new Web app and run dnu build command I get bellow error. Any thoughts how to fix it?
Logs: https://gist.github.com/prashantvc/73e1e9b5c71b26b2ba0e
Update 7-Dec-2015
dnu restore execute worked fine, output and project.json is here https://gist.github.com/prashantvc/9c0230f7fe058e80be2c
But, I am still not able to build the project :(

Polymer grunt: Fatal error: spawn dev_appserver.py ENOENT

I'm trying to run the Polymer Docs locally, but I get an error when trying to serve the app with grunt:
Running "appengine:run:frontend" (appengine) task
executing: dev_appserver.py --port=3000 --host=0.0.0.0 .
Fatal error: spawn dev_appserver.py ENOENT
(Full output)
The only relevant info I could find was this on the polymer-dev forum, but in that case the issue was using the incorrect Google App Engine SDK. I am using the Python SDK and I'm running Python 2.7.9.
EDIT: If you're finding this now, it's much easier to avoid this issue and use Gulp instead, basing it off of the Polymer Starter Kit gulpfile.
I was having the same troubles on Ubuntu 14.04. The solution for me was to add the absolute path to the Google App Engine Python SDK directory to my $PATH environment variable.
Edit shell startup script (I'm assuming you're using bash):
vim ~/.bashrc
Add the absolute path to Google App Engine directory:
PATH="$PATH:/absolute/path/to/google_app_engine"
Save and close file.
Remember that the changes won't take effect until the next time your shell starts up, so close and re-open your terminal now.
If that doesn't help, keep in mind that the ENOENT error generally means that a script is trying to access a file or directory that doesn't exist. So, for some reason, the path that Grunt is using to access the Google App Engine is incorrect.

Resources