What is the purposes of exe files in the MVC5 projects? - c#

In MVC5 Project there are 3 exe files:
My web-hosting provider is not letting me to publish exe files, and he told me to delete them.
During web-deploy I remove selection for this 3 files and publish the rest of the project.
When the publishing process finish and I try to access my website I got the error message that the csc.exe is missing :)
Can I do something to not publish exe files and also my website to run as expected?
Edit - I changed MVC4 with MVC5!
Edit - I discuss with my web-hosting provider and he allowed me to read/write exe files and now my project is running as expected.

You can find a comprehensive explanation here:
https://visualstudiomagazine.com/articles/2012/03/20/10-questions-10-answers-on-roslyn.aspx
And here:
http://blogs.msdn.com/b/webdev/archive/2014/05/12/enabling-the-net-compiler-platform-roslyn-in-asp-net-applications.aspx
I got the sabe issue with exe files, so I've unnistalled it using the command prompt in the Visual Studio 2015:
uninstall-package Microsoft.CodeDom.Providers.DotNetCompilerPlatform
After uninstalling this package, these "exe" files are not being created in the bin Folder anymore.

Related

Visual Studio deletes all dll, pdb, xml files from Debug directory and requires publishing when I tried to publish application - how to restore them?

I am developing .NET 4.6.1 Console application with NuGet packages in with Visual Studio 2019 Community Edition and VS places all the NuGet-retrieved dll and compiled pdb, xml files in src/Debug directory. I guess that it is by default.
My project succesfully compiles, can be debugged and executed. But then I have tried to publish it. I received error message Error An error occurred while signing: Failed to sign bin\Debug\app.publish\MyApplication.exe. SignTool Error: Invalid option: /fd com.mycompany.myapplication and I could see that all the dll, pdb and xml files are deleted from my Debug directory and new directory bin\Debug\app.publish has been created but with the exe file only.
So - after I tried to publish application 2 bad things happened:
dlls from NuGet packages have been delete, as a result I can not run my exe file any more;
And now the Visual Studio tries to publish application each time I am trying rebuild my project. And this publishing fails with Failed to sign bin\Debug\app.publish\MyApplication.exe. SignTool Error: Invalid option: /fd com.mycompany.myapplication, as a result I can not even rebuild my exe file.
How to decouple Rebuild from publishing and how not to do publishing during Rebuild time? And how to restore dlls from NuGet packages in my Debug directory? I.e. how to undo all the bad things that started to happen since I tried to publish application?
I have followed https://stackoverflow.com/a/56739494/1375882 and executed 'Create Test Certificate...' with sha1RSA and after that both Publish and Rebuild happens as expected and even dll/pdb/xml files are restored automatically in my Debug directory. So, that solved the question, but maybe in suboptimal way...

Visual Studio "Unable to copy file" during publishing

I keep getting this error during the publishing of my VS 2019 C# win forms project
Unable to copy file "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.TextManager.Interop.8.0.dll" to "bin\Debug\app.publish\Application Files\Database Client_2_0_0_47\Microsoft.VisualStudio.TextManager.Interop.8.0.dll". Could not find a part of the path 'bin\Debug\app.publish\Application Files\Database Client_2_0_0_47\Microsoft.VisualStudio.TextManager.Interop.8.0.dll'. Database Client
This also happens with 4 other DLL's with some being from VS 2019 itself and some from NuGet packages
This has only started happening recently so I'm unsure whether this is an issue with VS 2019 as no fundamental code has been changed and the only thing that has is some logos on a few .rdlc documents (Microsoft Report Viewer).
I'm running VS 2019 Community on version 16.11.4 with only .Net Desktop development, Office/Sharepoint development and a few individual packages installed.
I've looked around and can only seem to find people having issues with the .exes themselves due to them still being open however this is not the case for me as I have checked and there are no background processes like devenv.
What's strange is both the Debug and Release build fine with no issues whatsoever.
I've also tried deleting the \bin and \obj folders to no avail.
Below are some images of my settings that involve publishing
Publishing Main Settings
Prerequisites
Deployment
It seems the solution to this problem, as #HansPassant commented, was to shorten the build path as it was exceeding the MAX_PATH variable.
Once my project was moved from the default C:\Users\Drew\source\repos\ to just the C:\ drive my project was able to publish successfully.

/usr/share/dotnet/sdks/microsoft.docker.sdk/sdk/sdk.props was not found

enter image description here
hi friends
While exploring the dotnet core with Linux, jenkins and docker I've face the build issue which gives the error in title "/usr/share/dotnet/sdks/microsoft.docker.sdk/sdk/sdk.props was not found". Because of this build is getting failed.
I checked the dotnet installation location to see that it was not available.
I know that this particular file will be available in this location on Windows with VS 2017 installed C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.Docker.Sdk\Sdk
how to get this installed or make it available on the linux box so that build can run smoothly.
PFA image which was run from the terminal for re-producing issue.
Any help will be much appreciated.
This is a known issue, see its issue on GitHub for details and updates. The problem is that a closed source component in VS is not part of the .net CLI.
The current workarounds are:
Copy the Microsoft.Docker.Sdk folder from your VS installation to the CLI version you are using. For example from
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Sdks\Microsoft.Docker.Sdk
into the folder
/usr/local/share/dotnet/sdk/1.0.4/Sdks/
If the Microsoft.Docker.Sdk folder contains more than the Sdk subfolder, delete those other folders (e.g. build, tools).
Create a second solution containing all projects except for the docker project (.dcproj) and only build that from the CLI.

File not found: project.exe

I have a project in Visual Studio 2010 that requires me to run it as an administrator. I have added the app.manifest file to the project and made the appropriate modifications there. I'm currently running this project under debug configuration. Unfortunately, when I open VS 2010 as an administrator and try to build the project, among other things it complains that it can't find the .exe file for the project (but the .exe file actually exists!).
Furthermore if I run this project as a non-administrator I'm able to build the project. Why is VS claiming that the .exe file does not exist?
Try deleting the files in
"your_solution_folder"\bin\debug
and
"your_solution_folder"\obj\debug
Try deleting .suo, clean and rebuild solution.
I was using the subst command to create a virtual drive that was the drive for the project. I had to run the command prompt as an administrator and execute the subst command and when I ran VS as an administrator after doing that everything built.

publish my project

I have little problem to publish my project in C# express edition 2008 (WinForms).
I saw from Google how to do the basic and go to project property -> publish
But now in the publish folder that was created under my main project's folder and I have there setup and one more file and folder named application files.
But when I run the setup or the other file I'm getting error:
cannot start application MYPROJECTNAME from this location because it
is already installed from a different location.
I have also in bin-> debug ->app.publish a setup file which works fine until it needs to use a txt file in my project and it says that the txt file can't be found.

Categories