"Csc.exe" could not be run. Access is denied (MSB6003) - asp.net-mvc

I just downloaded and installed Xamarin and selected the ASP.NET MVC template. I haven't touched anything. When I build the solution I get the following error:
Could not add packages.
"The specified task executable "Csc.exe" could not be run. Access is denied (MSB6003)".
This is at the end of messages displayed on the Package Console:
Added file 'packages.config'.
An exception was thrown while dispatching a method call in the UI thread.
I'm running Windows 8.1 and Visual Studio Community 2015.
Any ideas?

Related

Publish Failed to sign msix

Using Visual Studio 2019 to publish an update to an existing windows store application. This worked a week ago.
Our solution builds without error. When I go to create the setup package I get an error "Failed to sign 'D:\dev\MeyerMusic\MeyerTablet\TabletDistribution\bin\AnyCPU\Release\MeyerMusicTabletSetup_2.6.6.0_AnyCPU.msix'."
We are distributing the application as a Microsoft Store app under the existing app name.
Last week on this same development computer I built version 2.6.5 as well as many packages before that.
The error number is blank or missing. I do not have a reason for the failure. I only see one fact in the error message and that points to line 4574 in the file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets
That line is this:
<SignAppxPackage Condition="'$(AppxPackageSigningEnabled)' == 'true'"
AppxPackageToSign="$(AppxMainPackageOutput)"
CertificateThumbprint="$(PackageCertificateThumbprint)"
CertificateFile="$(PackageCertificateKeyFile)"
CertificatePassword="$(PackageCertificatePassword)"
HashAlgorithmId="$(AppxHashAlgorithmId)"
EnableSigningChecks="$(EnableSigningChecks)"
SignAppxPackageExeFullPath="$(SignAppxPackageExeFullPath)"
TempCertificateFilePath="$(TempCertificateFilePath)"
VsTelemetrySession="$(VsTelemetrySession)"
SigningTimestampServerUrl="$(AppxPackageSigningTimestampServerUrl)"
SigningTimestampDigestAlgorithm="$(AppxPackageSigningTimestampDigestAlgorithm)"
/>
Troubleshooting steps:
Attempted to build a side load package. Results in same error
Successfully built a side load package that was not signed
I have restarted Visual Studio
I have rebooted the machine
I have deleted OBJ, BIN for the entire solution
I have looked for errors in the event log but none have been found so far.
After uninstalling KB4535996 the problem was resolved.
I found this via a tip from the following post: https://developercommunity.visualstudio.com/content/problem/934967/uwp-error-failed-to-sign.html

"The process cannot access the file" error when publishing projects in VS 2017

from time to time when I publish my visual studio 2017 projects I get the "the process cannot access the file" error on some of the dll's . The error is pasted below. Does anyone know what is causing this.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\Web\Deploy\Microsof
t.Web.Publishing.Deploy.FileSystem.targets(96,5): error : Copying file obj\Debug\Package\PackageTmp\bin\EntityFramework
.dll to C:\Websites\MyWebsite\bin\EntityFramework.dll failed. The process cannot access the file 'C:\Websites\
MyWebsite\bin\EntityFramework.dll' because it is being used by another process.
There is no pattern on the occurance of this error. It occurs randomnly on different dll files.
When this error occurs, I restart my visual studio / computer and then try another publish and it starts working.
Does anyone know what would be a permanent solution to fix this?
Before you publish, select target location different from default location. This will avoid "the process cannot access the file"

Wix ICE Error from 01 to 07

I have to update our build-system from the old "XML-System" to the newer vNext.
Now I have the problem, that in a build progress, I'm getting errormessages from ligther.exe:
[error]light.exe(0,0): Error LGHT0217: Error executing ICE action 'ICE01'. ...
up to ICE07.
And at the end:
[error]light.exe(0,0): Error LGHT0216: An unexpected Win32 exception with error code 0x643 occurred: Action - 'ICE09' Fatal error during installation
When I make the same build with the "old" XML-Version it works without any problems, any ideas?
Thanks a lot.
Kriz
According to the error prompting message: An unexpected Win32 exception with error code 0x643 occurred: Action - 'ICE09' Fatal error during installation
It's probably a permissions problem with validation. You could try to give the build service account more privileges such as local administrator permission on the build agent.
Besides, there are no tools to convert XAML build definition to vNext directly, so please double check you have manually created fully in a accord.
I saw this issue only on the build machine, where the build task has no admin rights.
I didn't saw this on my developer machine, where I have admin rights. This error is written by the light.exe, which is the Windows Installer XML linker contained in the Wix Toolset.
In order to solve this I suppressed validation of the light.exe. This can be done in two different ways:
On the commandline of light.exe
-sval
On the commandline, when using WixSharp
Compiler.LightOptions = "-sval";

Msbuild error: failed to start monitoring file changes

when i run Msbuild web.csproj i get the following error:
AfterBuild target> -> C:..\web\obj\debug\csautoparameterize\original\web.config
: error ASPconfig: an error occurred
loading a configuration file:
Directory C:..\web\obj\debug\csautoparameterize\original\Configs'
does not exist. Fail to start
monitoring file changes.
if i open visual studio (2010)..clean solution and rebuild, its fine. if i try to do publish via visual studio, this error returns and i cant build again (until i clean solution).
any ideas?
thanks
Is that a network drive? I was getting a similar error when I had my SVN working copy on a network drive, apparently the folder monitoring service for the test server completely freaks out when it's not a physical drive.

azure developement fabric dll hell

Hello I am trying to package and start up azure developement fabric on a windows 2008 server, I am so close yet still far. The steps I take are
1) run cspack.exe command /copyOnly to generate the .csx folder
2) run csrun.exe commmand /LaunchBrowser to start up the developement fabric and startup the browser
the error is as follows
System.BadImageFormatException: Could
not load file or assembly
'Interop.SSCE' or one of its
dependencies. An attempt was made to
load a program with an incorrect
format.
== Pre-bind state information === LOG: User = IP-0AE2B2DF\Administrator LOG:
DisplayName = Interop.SSCE (Partial)
LOG: Appbase =
file:///C:/Users/Administrator/Documents/Visual
Studio
2010/Projects/MyAzureProject/src/AzureCloudService/ServiceDefinition.csx/roles/MyAzureProject.Web/approot/
LOG: Initial PrivatePath =
C:\Users\Administrator\Documents\Visual
Studio
2010\Projects\MyAzureProject\src\AzureCloudService\ServiceDefinition.csx\roles\MyAzureProject.Web\approot\bin
Calling assembly : (Unknown).
=== LOG: This bind starts in default load context. LOG: Using application
configuration file:
C:\Users\Administrator\Documents\Visual
Studio
2010\Projects\MyAzureProject\src\AzureCloudService\ServiceDefinition.csx\roles\MyAzureProject.Web\approot\web.config
LOG: Using host configuration file:
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Aspnet.config
LOG: Using machine configuration file
from
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
LOG: Policy not being applied to
reference at this time (private,
custom, partial, or location-based
assembly bind). LOG: Attempting
download of new URL
file:///C:/Users/Administrator/AppData/Local/dftmp/s0/deployment(98)/res/deployment(98).AzureCloudService.MyAzureProject.Web.0/aspNetTemp/aspNetTemp/root/dfbc079a/82bed8d5/Interop.SSCE.DLL.
LOG: Attempting download of new URL
file:///C:/Users/Administrator/AppData/Local/dftmp/s0/deployment(98)/res/deployment(98).AzureCloudService.MyAzureProject.Web.0/aspNetTemp/aspNetTemp/root/dfbc079a/82bed8d5/Interop.SSCE/Interop.SSCE.DLL.
LOG: Attempting download of new URL
file:///C:/Users/Administrator/Documents/Visual
Studio
2010/Projects/MyAzureProject/src/AzureCloudService/ServiceDefinition.csx/roles/MyAzureProject.Web/approot/bin/Interop.SSCE.DLL.
ERR: Failed to complete setup of
assembly (hr = 0x8007000b). Probing
terminated.
this error happens with 2 dlls Interop.SSCE.DLL and SqlLite.dll Ive replaced all references to SqLite dll with a 64bit version and I dont have any references anymore to Interop.SSCE.DLL since I am not using it. Manually deleting these assemblies from the location
"C:\Users\Administrator\Documents\Visual Studio
2010\Projects\MyAzureProject\src\AzureCloudService\ServiceDefinition.csx\roles\MyAzureProject.Web\approot\bin"
solves the issue, but I dont obviously want to manually delete these everytime as I trying to automate a build process. My question is then how is the .csx folder actually generated and will this give me clues as to where these dll's are bring copied from? This is really frustrating as with the exception of those dll errors, I =m able to package the solution and startup the developement fabric with no other problems. Please Help!!
I realize this is old, but I just ran across it while trying to solve the same problem. In my case, the issue was that some of my projects were set to build x86 assemblies, instead of Any CPU. The solution was:
Go to Build -> Configuration Manager
Make sure "Active solution platform" is set to "Any CPU"
Make sure each of the projects also has the "Platform" set to "Any CPU"
Rebuild
Go to:
Tools > Options > Projects and Solutions > Web Projects
Check the Use the 64 bit version of IIS Express for web sites and projects.
This will ensure that your web project runs in x64 mode and will thus be able to use Service Fabric files.
Hope it helps...

Resources