I'm trying to run a local instance of an Azure Worker Role for debugging and testing, but for some reason, my Role will not deploy to the Emulator locally, it is saying, "The compute emulator had a error: Found too many .csdef files.."
The problem is, I checked the project directory, and there is only one csdef file...
I have already built the file as required with CSPack, and my CSRun command looks like this:
csrun.exe /run:C:\ODA
T\WorkerRole\WorkerRole;C:\ODAT\WorkerRole\WorkerRole\
ServiceDefinition.csdef
And this is being ran at the following director: C:\Program Files\Windows Azure Emulator\emulator
Any help is greatly appreciated!
Try using the cscfg file not the csdef and use the .csx directory for the emulator.
csrun C:\ODAT\WorkerRole\WorkerRole.csx C:\ODAT\WorkerRole\WorkerRole.cscfg
If you don't have a .cscfg file you can have cspack create it for you by specifying the /generateConfigurationFile:ServiceConfiguration.cscfg
Related
We had a Jenkins job running without issues for a couple of months now but recently it started failing.
It has this error when running form Jenkins:
CSC : error CS7028: Error signing output with public key from container 'Container_ID' -- The file exists. [lgw0hqij.tmp_proj]
It seems to rename the file every time.
I have logged into the host and executed as the user but it gives no error when running normally.
Once I run the user as an administrator, it starts giving the issue.
Running the application from Visual Studio does not give an issue at all!
I have tried running Jenkins as a LocalService as well as a lower privileged user, but same result.
I have also followed this, but doesn't seem to help.
I'm running out of ideas
EDIT
For anyone facing the same issue in the future. This error is linked to the user account temp folder
C:\Users\<username>\AppData\Local\Temp
Once you clear this folder, your msbuild should be working fine
For anyone facing the same issue in the future. This error is linked to the user account temp folder
C:\Users\<username>\AppData\Local\Temp
Once you clear this folder, your msbuild should be working fine
I have a project that needs to collect several data and put it in a single pdf, to do so I used Rotativa wrapper. It works fine on my local service fabric cluster and Im able to generate the pdf using ViewAsPdf and then getting the byte array to attach it in an email. The problem comes when I deployed the project in Azure (service fabric cluster) and Im getting this error:
at Rotativa.AspNetCore.WkhtmlDriver.Convert(String wkhtmlPath, String switches, String html, String wkhtmlExe)\r\n at Rotativa.AspNetCore.WkhtmltopdfDriver.ConvertHtml(String wkhtmltopdfPath, String switches, String html)\r\n at Rotativa.AspNetCore.ViewAsPdf.<CallTheDriver>d__19.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---
Things that Ive tried:
Installed Visual C++ Redistributable Packages for Visual Studio 2013 and 2015 in x64 and x86 versions in the service fabric node (where the project is being deployed)
Moved the Rotativa folder from wwwroot to the root path of the project and set the path in RotativaConfiguration.Setup() method
Copied msvcp120.dll and msvcr120.dll to the Rotativa folder
Installed wkhtmltopdf.exe in the service fabric node
I installed Rotativa.AspNetCore 1.0.6 nuget package
I use ViewAsPdf to render the razor view and I call BuildFile method to get the byte array
If I ran the wkhtmltopdf.exe in the command line in the service fabric node I get: "The application was unable to start correctly(0xc000007b) Click ok to close the application"
The service fabric node is a Windows machine. The project is built with aspnet core 2.0
Any help will be appreciated. Thanks!
I assume is a missing dependency issue.
Based on the scenario and message you provided The application was unable to start correctly(0xc000007b) there are other related problems:
The application was unable to start correctly (0xc000007b) and Error : the application was unable to start correctly
The other issue might be lack of permissions to run or access specific dependencies.
I would suggest you try:
running as administrator first via command line.
Check firewall or network\website permissions
Use dependency walker and check the dependencies it loads\fail and verify if they are installed on the server.
As a workaround you could create a container to run this. It would save you the trouble of going into the nodes to install stuff, which limits your scale out & fail-over options.
There are some people who got it working.
When start build on my Bamboo server ,I am getting following error:
Using shared compilation with compiler from directory: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\Roslyn
CSC : error CS2001: Source file 'C:\Windows\system32\config\systemprofile\AppData\Local\Temp.NETPortable,Version=v4.5,Profile=Profile78.AssemblyAttributes.cs' could not be found. [E:\bamboo-agent-home\xml-data\build-dir\Domain\Domain.csproj]
Done Building Project "E:\bamboo-agent-home\xml-data\build-dir\Business\Business.csproj" (default targets) -- FAILED.
Unable to understand this error. On Local this works perfect even on command line - MSBuildcommand.
It looks like your build service is running as a system account (e.g. local system, network service, etc.) which leads to undesired behaviour in msbuild.
You should create a dedicated service user and configure the service to run as this user or ensure that the service user has sufficient rights to modify the system profile directory (which I don't recommend).
You can follow Atlassian's guide on how to run the windows service as a local user.
I have a C# Web API Elastic Beanstalk app which needs a folder outside the deployment directory that the IUSER and IIS_USERS users can write to. I've created a .config file and put this in the top level .ebextensions folder in my project. The contents are below:
commands:
0_mkdir:
command: mkdir C:\\AppFolder\\
1_set_iuser_permissions:
command: cacls C:\\AppFolder\\ /t /e /g IUser:f IIS_Users:f
However while the folder is created successfully the permissions aren't set. If anyone has any idea what I am doing wrong I would be hugely grateful. Big thanks in advance.
In the end I switched to using Json instead of YAML as, despite my YAML being validated by several online YAML testers, AWS still wouldn't accept it. It always had issues with the parameters passed to icacls. I also changed to a folder within the application App_Data folder as setting permissions on any directory external to the application didn't appear to work. So, my final configuration file is as follows:
{
"container_commands": {
"01": {
"command": "icacls \"C:/inetpub/wwwroot/AppName_deploy/App_Data/AppFolder\" /grant DefaultAppPool:(OI)(CI)F"
}
}
}
Hope this helps someone else out.
It looks like you are using invalid .net accounts (unless these are custom accounts you created). That is part of the reason why your permissions are not being set. They should be IUSR or IIS_IUSRS
Furthermore, container_commands executes after your app/server environment has been setup, but before your deployment has started. There is no other way to set permissions on files/folders within your deployment directory other than using a wpp.targets file within visual studio.
The following SO post is a good read using wpp.targets to solve your issue.
Can Web Deploy's setAcl provider be used on a sub-directory?
Place a file 01_fix_permissions.config inside .ebextensions folder.
contents:
files:
"/opt/elasticbeanstalk/hooks/appdeploy/pre/49_change_permissions.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
sudo chown -R ec2-user:ec2-user tmp/
I have an xml file in my project that is supposed to be for used for read operations. And it works the project works fine when i run it on my local machine, however it throws System.UnauthorizedAccessException: Access to the path 'E:\approot\... when i deploy the worker role.
I have checked that the file exists in that directory.
How can i fix this issue?
Thank you.
You need to run role in elevated mode...by adding
< Runtime executionContext ="elevated" /> in csdef.