I am doing my code on windows system and when I transfer my code to mac and open .sln file then two error occures:
Cloud not load solution "Directory of project".
Load Operation Failed.
And when we open old code then it works fine.May be there is some version mismatch in new code.
Changed in directory problem solved!
I have asp core api project and i am using visual studio 2017 to run my project.
After i renamed the docker container that was previously created using visual studio using this command on command line,
docker rename CONTAINER NEW_NAME
I receive the following message when i try to run the project again in visual studio.
Thanks for the help
Can not find docker container with the name starting with 'previous_container_name'.
Delete the .vs folder in your solution directory (close the solution first), the Docker image name seems to be cached somewhere in there.
This error started happening to me when someone on the team unchecked the build checkbox for the docker-compose project. Make sure it is enabled in Build -> Configuration Manager
I had a similar problem, and it was caused because I started Docker after opening the project. VS does some things with Docker on opening of the project, and will fail if Docker is not started.
Lesson learned: make sure Docker is running before starting Visual Studio. If Docker is not started, then start Docker, close your solution, and re-open it.
VS will re-create the container as it opens the project.
This happened for me because I stopped a container manually via the commandline, then Visual Studio got confused.
To get round the issue I simply added a single ' ' space character to docker-compose.yml and saved the file. This forced Visual Studio to restart the container and connect to it.
I'm sure starting/stopping Visual Studio would also have worked, but the whitespace change was nice and fast.
I also have the similar problem.
These steps always help me to solve the issues.
Solution 1:
1- Close VS
2- delete obj folder of root solution folder.
3- delete obj folder of all projects which are involved in docker-compose file.(example all APIs)
4- Open VS
5- Remove the docker-compose project from solution and add it again.
During the creation process, don't overwrite the old files with new ones, to prevent deletion of you current docker-compose.yml configuration.
Solution 2:
On the first time of container creation, copy the creation command:
example: docker-compose -f "[path]\docker-compose.yml" -f "[path]\docker-compose.override.yml" -f "[path]\docker-compose.vs.debug.g.yml" -p dockercompose17926074389345686639 --no-ansi up -d --no-build --force-recreate --remove-orphans
any time there is an error just run this command manually.
if anybody could find a constant solution please also let us know.
One more cause is using solution folders for your docker project and a version of Visual Studio 2017 less than 15.9, upgrading to 15.9+ fixed this for me, see this issue.
In my case i have tried all of those but solution is very simple in V.S. 2019
Before all there is a bugfix packet for visual studio 2017 even if you using 19 beta, for this on https://visualstudio.microsoft.com/vs/
Download and install that pocket.
For automatically composing also you should add Docker Compose Support follow this link https://learn.microsoft.com/tr-tr/dotnet/standard/containerized-lifecycle-architecture/design-develop-containerized-apps/visual-studio-tools-for-docker
1-) Right click to targeted project root folder on solution explorer that contains Dockerfile and select add-> Docker Support it will ask you its always contains would you like to create new one? Click yes. It will create new Dockerfile.
You will see some changes in new Dockerfile like your project changes or nuget package changes affectness
2-) Right click the newly replaced Dockerfile and Build Image.
It will successfully build
3-) Choose debugger as Docker instead IIS Express vs. Even don't use other debugger while developing project if you do not need
In my case, I had both the "image" section and the "build" section in my docker-compose.yml. I just removed the build section because I wanted it to pull an image from the docker registry, and now it is working.
If your project uses Launch profiles to run, I fixed this with the following steps:
Open Manage Docker compose launch settings VS.
Select the Launch Profile you are currently using to run the application.
Check id the specific service is selected in the launch profile or not. All the services you intent to run should be part of the Launch profile.
I am getting this weird error on Windows 10 when I try to build any project. The projects are working fine if I build them on other OS.
The specified task executable "cmd.exe" could not be run. The
specified executable is not a valid application for this OS
platform.
When I tried to check the log I got to the following code in Nuget.targets file inside .nuget folder, I commented the code and the project builds fine now. I don't understand why the error. Any new projects that I create are working fine...
I am using Visual Studio 2013 on Windows 8, Windows Server 2008 and Visual Studio 2015 on Windows 10.
Code:
<Exec Command="$(RestoreCommand)"
LogStandardErrorAsError="true"
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
What is the reason for this error ?
Is it because of OS or because of Visual Studio ?
How do I resolve it? I don't think commenting the code is the way to do it...
I got the same error, and repairing the corrupted files solved my issue. Try this:
In administrator command prompt, run sfc /scannow
It should emit log file in %windir%\Logs\CBS\CBS.log. Confirm that it repaired cmd.exe. For me I saw something like this Repairing corrupted file [ml:48{24},l:46{23}]"\??\C:\WINDOWS\SysWOW64"\[l:14{7}]"cmd.exe" from store
If that doesn't help you can try DISM /Online /Cleanup-Image /RestoreHealth
See more here
It happened to me when building my project on Windows 10. The problem was that the path of one file was very long (longer than 260 characters). So, by making it shorter, the problem solved for me.
I had the same problem with VS c++ OpenFrameWorks. I tried your suggestion but could not solve the problem. I solved it differently as under.
Soln:
Project Properties ->
Build Events ->Post-Build Event -> Command line
"robocopy "$(OF_ROOT)/export/vs/$(Platform_Actual)/" "$(ProjectDir)bin/" "*.dll" /njs /njh /np /fp /bytes if errorlevel 1 exit 0 else exit %errorlevel%"
Removed Above line from command-line.
OK, Solved.
If you started to face this error after deleting some files :
Unload your project
Edit Your csprok
Delete any reference for the your deleted files
Reload your project and Build
I faced the same issue when building a .NetCore App using a template that includes an Angular app with it, and i tried to delete the ClientApp folder. I had to remove multiple Target and ItemGroup tags from within the csproj.
To those who have landed here:
If you get this message I suggest that you do not, as #Hans Passant suggested, first assume that your machine or Windows has been corrupted.
Instead, I recommend that you suspect that your anti-virus or Carbon Black installation is to blame.
This was the case for me.
Someone from my IT Department disabled a certain Carbon Black policy and everything magically worked again.
In Visual Studio 2013 I am attempting to File Publish my website project to a remote web server. I am getting the following error:
C:\Program
Files\MSBuild\Microsoft\VisualStudio\v12.0\Web\Transform\Microsoft.Web.Publishing.AspNetCompileMerge.targets(720,5):
Error MSB3231: Unable to remove directory
"obj\Release\AspnetCompileMerge\TempBuildDir". Access to the path
'AdditionalPhotos.aspx' is denied.
I have tried cleaning and rebuilding, with no luck. Restarting VS did not help. I checked the permissions on the directory and file referenced in the error and Windows Explorer would not let me see the file and folder permissions (You do not have permission to view or edit this object's permission settings.) The project is stored on a network drive, and I am administrator of that drive, so I'm not sure why I can't see permissions there.
Any ideas as to how to get around this issue? Thanks for your help!
I installed 11.1.1.5 just now, and am getting this error every time I try to open a project or a directory in a project, I get the following error:
java.lang.IllegalStateException: Timer already cancelled.
And it doesn't display the files.
To exclude any other factors I did a fresh install in a new Ubuntu VM image - same problem.
I'm really at my wit's end.
I solved the problem by deleting all local projects and checking out the source code again.