Resource file "**/*.resx" cannot be found. (MSB3552) on VS for Mac

Viewed 18129

We can't build solution on vs for Mac version but the same solution can build on vs for windows (vs 2017) and it's worked.

How to fix on this problem ? and can support on both (vs on windows & vs on Mac)

Thanks you. enter image description here enter image description here

/Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets

17 Answers

I was running dotnet core on osx and had the same issue. The problem was that I generated a folder using a windows path. When created on disk, it was not visible in Finder due to its naming \Uploads. Do a ls -la and see if there are any strange folders or files in there. See Image

I was trying to fix that problem like a two months and finally found what's wrong. I had backward slash '\' in project files which is Windows style path, but I am using Mac so it was creating directory with plain name 'wwwroot\test' (not nested). If I remove that folder it successfully builds.

Check into Finder, in my case, the problem was with the path:

enter image description here

I experienced the same thing this evening and I got it to work. I ended up just doing a clean and a build and it worked just fine.

I did however copy the project on a thumb drive and I wasn't using something like Github to transfer the project over. I'm guessing it had some remnants from VS on Windows in the bin/obj directories.

Had the same error; figured it had to be due to the path using backslashes after reading these answers.

I messed around with deleting lines that referenced a file using \ in the .csproj file, to no avail.

Took me a while to find it, but I noticed something had created a wwwroot\ImageCache directory. I deleted this directory and the build worked.

There is an oddly named folder in your project subtree on the Mac. In my case, it was c\/output/.

Delete that folder and the build will be successful.

Then fix the part of your code where the developer used the Windows-specific path separator ('\') instead of Path.DirectorySeparatorChar.

"dotnet run" command was creating an unnecessary keys file every time I run that command. I had to delete this folder to make it work again. This is caused due to usage of windows style path like "C:\SharedDataProtectionKeys" instead of relative path that works for both windows and Linux environments Unnecessary key file

Verify that in your project file structure you do not have any new files generated, and as in my scenario you did not create any new .csproj, .vbproj or .fsproj files (which could be nested somewhere deep). Deep file paths also can cause this non-verbose issue. Make sure you do not nest stuff too deep.

We removed obj and bin but doesn't work we removed all of the files which are created with "\" but the project doesn't work. At finally we pull the project from git and build again and it works (Note: We don't do new commit when cloning the project from git)

I think it can be happened cache or like that

In macOS, you can create a folder containing slash or backslash.

enter image description here

Problematic code on macOS example:

var path = Path.Combine(HostingEnvironment.ContentRootPath, "UploadedAttachments\Answer");

if (!Directory.Exists(path))
{
    Directory.CreateDirectory(path);
}

There's another posibility how it might happen. Experienced on Windows (10) and VS 2017 when moved and renamed a checkout (svn). Maybe because there were some broken symbolic links.

What helped: Copy the checkout instead of moving it, don't follow any symbolic links.

If you are building your project through Docker, set WORKDIR explicitly.

eg: WORKDIR /app

If your project is stored in a OneDrive synced folder, this is possibly the culprit. I was getting this error and realized I had a number of folders giving the error "The Tag Present in the Reparse Point Buffer Is Invalid" in my project directory. Running chkdsk /f /x (and restarting because this was on my main drive) fixed this for me, but this article details some other fixes if this does not fix it for you

I had the same problem and I deleted some new directories with backward slash "" created in my project, deleted all those directories and build worked fine.

Related