C# Couldn't process file xxx.resx due to its b

2019-01-28 02:47发布

I have issue while i try to build project in VS2012.

Can't build due to error:

Couldn't process file xxx.resx due to its being in the Internet or Restricted zone or having the mark of the web on the file. Remove the mark of the web if you want to process these files.

similar question is here Couldn't process file resx due to its being in the Internet or Restricted zone or having the mark of the web on the file

but I try that option and have no luck, because I didn't downloaded file from internet. That project was build from scratch. In project after selecting Properties, in Windows Explorer nothing happened, i don't have "unblock" option, only default 3 options (read only, hidden, archived).

I have same error and can't build or rebuild project. I have theory that is recent error after update Windows. Before update, everything works fine. Any ideas ?

6条回答
叼着烟拽天下
2楼-- · 2019-01-28 03:29

I'm not really sure either, I have the exact same issue.

But, what i did, was hit view in file explorer.enter image description here

Then, i clicked show hidden items. enter image description here

Finally, i went back to my folder and clicked on the .vs folder, my project/file name, v15, Server, sqlite3, and deleted DB.Lock.

enter image description here I reopened the project, clicked build, and it worked perfectly.

This worked for me, it might/might not for you.

查看更多
成全新的幸福
3楼-- · 2019-01-28 03:38

Go to xxx.resx file in Windows File Explorer. Right-click and select properties. At the bottom of the the dialog is an "unblock" option:

Unblock option

Check this and click Apply. Clean your solution and it will build.

查看更多
小情绪 Triste *
4楼-- · 2019-01-28 03:38

Had the same problem after updating to VS 2017 v15.8.5, and none of the solutions above or on other forums worked for me.

So, since a .resx file is just XML, I just copied the content, deleted the original file and recreated it with the copied content.

That was the only thing that worked, and it worked first time.

查看更多
时光不老,我们不散
5楼-- · 2019-01-28 03:40

I just ran into the same issue and also tried the Unblock option from explorer with no luck. I even restarted VS with no luck.

However, I'm not sure which combination did the trick but I opened the form as well as the resx file from within VS, just to see if I can open it, which opened fine. I then did a clean and rebuild and that appeared to do the trick. If it doesn't try restarting VS after the clean then rebuild.

查看更多
叼着烟拽天下
6楼-- · 2019-01-28 03:45

I had a similar issue and the problem was an image that I had downloaded and added to my Resources. Not completely sure why that was the only image that gave me problems, however, I opened my abc.resx file giving me issues an a text editor, removed the node starting with " (it was the last and only node) just like Albert Alberto mentioned. Saved the changed, cleaned and rebuilt my solution and it all works! The image didn't render but it only took a second to go back and add the image. It wasn't removing the entire file, just the node that was causing the issue.

查看更多
We Are One
7楼-- · 2019-01-28 03:48
  1. On the solution folders locate abc.resx.

  2. Open the file using any text editor, preferably Notepad++.

  3. Locate and delete any node starting with "

Example. This is what you should delete.

<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
        AAABAAMAICAAAAEAIACoEAAANgAAAGBgAAABACAAqJQAAN4QAACAgAAAAQAgACgIAQCGpQAAKAAAACAA
        AABAAAAAAQAgAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 
         ///////////8AAB///////// 
     </value> 
 </data>
  1. Reload or reopen your solution and build. You are ready to go.
查看更多
登录 后发表回答