Access is Denied when trying to add a resource to C++/CLI project - visual-studio-2012

I am trying to add a resource to my C++/CLI project. I am working with Visual Studio 2012. TFS 2013.
Right Click on the project => Add => Resource => I get the error.
Error:
The operation could not be completed. Access is denied.
I do not understand why I am getting this error. I don't know how to fix it. So far:
I checked-out the entire project (Project and all its files)
I removed the "Read-Only" mark of the folder and all the files inside it.
I can add other files and edit everything, but for some reason I can not add resources.
I can edit the resource file in Notepad, so I don't know what else to do. (I even rebooted just in case).
I can add resources to a C++ Native Library I have in the same project.
What else could be causing this error?

This happened to me because I had still opened the resource (*.rc) file in the Resource Editor and/or Text Editor. As soon as I closed it, I was able to add resources again.

It seems the Resource file was somehow corrupted. After trying different approaches, I kept getting the same error, while I could easily add resources to other projects.
I deleted the resource file and everything related, and created everything from scratch and it worked.

Related

Assembly information - The system cannot find the path specified

I have absolutely no idea, what does it means? I only press OK in assembly information in order to specify Assembly Version.
What paths is absent? And what operation VS2022 can not finished? It looks as Visual Studio programmers what is useful error messages are.
I just ran into this problem and for me it was a VB project, and when you modify the AssemblyInfo, it tries to write the AssemblyInfo.vb file to the .\My Projects\AssemblyInfo.vb. Normally when you create a fresh project, I think this folder is created automatically so VS assumes it's there and gives you this error if the folder is missing.
In my case the folder was not checked in to git, so when I checked out the project the folder was not there. I would assume the same is true for c# projects, except the folder expected would be .\Properties\AssemblyInfo.cs.
All I had to do was create the "My Projects" folder at the root of my project and the error went away. It appears you are using c#, so try creating a "Properties" folder at the root of your project and see if the error goes away.
I still don't understand what path Vs2022 can not found and what operation VS2022 can not complete, but manually add CS-file with needed attributes solve this issue.

Visual Studio 2015 MVC Project Template Access Denied

I've created a very simple MVC application in VS2015 which has some basic CSS styling and some HTML to get an application off the ground more quickly.
The application runs perfectly.
I've exported this as a template using File -> Export Template...
I then created a brand new project based off this project type. So far so good. But, now when I run the newly created project I get a blank page with "Access Denied" (see image).
I've been going over the template project and the new project with a fine tooth comb and I can't find any differences. Why would one work but the other give an access denied? I am out of ideas, any help is appreciated.
EDIT:
After more research I have found the cause of the problem, but not a solution.
It seems that the project template has "Anonymous Authentication" as Disabled, and has "Windows Authentication" set to Enabled in the project settings. However when I create a project based on the template these values are flipped and thus causes the Access Denied.
Here's an image of the project settings in the template:
Here's an image of the project settings in the "new" project:
Note that both Authentication settings are flipped. Can anyone tell me how to get this to not happen?
Edit 2:
As suggested, the applicationhost.config files are different which is causing the above problem. Here is the applicationhost.config security section of the Template:
However, here is the same file in the new project created based off the template:
Notice that the section is missing entirely from the new project. So, now the question becomes how do you get this to copy over to new projects?
As suggested by BrianLegg I move my comments to an answer
Seems that the problem is related with the applicationhost.config file. This files it's not present on the zip file which contains the template.
You could take a look on the physical path attribute on
<system.applicationHost>
<sites>
Maybe it's trying to access to the first project instead the new one.
Could you check what is in your applicationHost.config template?
Take a look on Where is the template for applicationHost.config file stored
have you had a look at the global routes? it could be something routes not created or corrupted?

"This file is currently not available for use on this computer"

I am hoping someone has had this issue before and can help me resolve. I was working on a company project. I had just finished up and needed to publish my project to the server. When trying to publish, I got the error "This file is currently not available for use on this computer."
So then I tried to open one of the .cs files of the solution, and the error occurred again from trying to open the file. So I tried to grab the latest version from TFS thinking it would give me whichever file is missing, but when I click "Get Latest Version" on the project, the error message pops up there too.
I thought surely I will be able to delete the project locally and then remap it, but I can't even delete the project off my computer, as the error message pops up halfway through deletion. When it occurs there, however, I do get "Error 0x800710FE: This file is currently not available for use on this computer."
Also have tried deleting offline cached files through Control Panel > Sync Center > Manage Offline Files > Disk Usage > Delete temp files
I got this error for a small, test solution that was not using TFS. The default file location is the documents folder, which in my environment is synced using the Sync Center. I moved all of the solution files to a new local folder that was not included in Sync operations and the error went away.
Conclusion: storing VS files in a folder managed by Sync Center is likely a bad idea.
I got this error when trying to save an excel file served from a webpage.
The solution for me was to save it under a different filename. Possibly because I previously had a file with the same name open in excel.

Visual Studio Team Services build error cannot copy AssemblyAttributes.cs

After adding a web role to my Azure project I get a build error within my Visual Studio Team Services environment. Though, I cannot figure out what is causing this. Where is AssemblyAttributes.cs comming from? I cannot find this file in my solution folder.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Windows Azure Tools\2.7\Microsoft.WindowsAzure.targets (2787, 5)
Unable to copy file "C:\Users\buildguest\AppData\Local\Temp\.NETFramework,Version=v4.5.2.AssemblyAttributes.cs" to "C:\a\6e05cef4\xxxx\xxxx.Backend.Api.Azure\obj\Debug\Tijdmunt.Ui.WebRole\C:\Users\buildguest\AppData\Local\Temp\.NETFramework,Version=v4.5.2.AssemblyAttributes.cs". The given path's format is not supported.
AssemblyAttributes.cs is a temporary generated file created by MSBuild, so It's not going to be on your solution. Instead it is going to be under the temporary folder.
Since It's a temporary file and created on every build, I just went to below location and deleted the file, then my solution started to be successfully building again.
C:\Users\UserName\AppData\Local\Temp.NETFramework,Version=v4.5.AssemblyAttributes.cs
Hope this helps someone else.

VS2012 Error when creating publish package: Exception in Executing Publishing Access to path is denied

I am trying to publish an application with VS2012 and when i try and make the package i get an error that access to the path is denied. I have checked and my user has full control and verified the path.
VS is trying to access .pubmxl file that is there.
I have also tried running VS2012 as administrator.
I had this same issue (VS2012: Access to path is denied when executing publish) and found a way to allow Visual Studio access to the file.
If you open the pubxml file in Visual Studio, make an edit, and save the file, Visual Studio is able to successfully publish using that file. Hope this works for you too.
Creating a new profile worked for me. I got this error when I tried to change the path of an existing profile, and Unfortunately I could not find the original pubxml file, otherwise I would have simply copied it to the new location and followed advice #1 (edit the file in location from VS2012). It's easy enough to create a new profile as there aren't many settings anyway.
I have experienced this issue and I noticed that the files were "Read-Only". Selecting the files and removing the "Read-Only" attribute allowed me to Publish successfully.
Sounds like TFS feature rocks again. Remove publish profile from local repo and get latest version afterwards, then you should be fine.
I had the same problem and fixed it by removing my Publish profile and creating a new one.

Resources