Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a new Resource (resx) file an error occurs #1409

Closed
davkean opened this issue Feb 1, 2017 · 39 comments
Closed

Create a new Resource (resx) file an error occurs #1409

davkean opened this issue Feb 1, 2017 · 39 comments
Assignees
Labels
Blocking-Release We cannot ship the current milestone without this feature. Bug This is a functional issue in already written code.
Milestone

Comments

@davkean
Copy link
Member

davkean commented Feb 1, 2017

This bug is created from customer feedback https://developercommunity.visualstudio.com/content/problem/15297/when-creating-new-resource-resx-file-error-occurs.html

When I create a new Resource file, I get following error: "Custom tool ResXFileCodeGenerator failed to produce an output for input file ... but did not log a specific error.". Project is ASP.NET Core on .NET Framework

@davkean davkean added the Bug This is a functional issue in already written code. label Feb 1, 2017
@davkean davkean added this to the 1.0 RTM milestone Feb 1, 2017
@davkean davkean self-assigned this Feb 1, 2017
@davkean
Copy link
Member Author

davkean commented Feb 1, 2017

This looks to occur when when RESX generator returns a null output, which it does apparently when it encounters an error.

I can't repro this. Ask the customer for more info.

@srivatsn srivatsn modified the milestones: 1.1, 1.0 RTM Feb 2, 2017
@Ponant
Copy link

Ponant commented Feb 10, 2017

@davkean, I had this issue several times, so I can certainly confirm it occurs. I made the test on

  1. A VS 2017 RC that has been updated successively for each release
  2. A fresh new VS 2017 RC (latest as of today) on a new windows 10 Pro.

This is with .Net Core 1.1 projects. There are two kinds of bugs that are frequent for resx's with VS 2017 RC.

  1. The one described here and which I often get if I copy paste the whole solution directory and launch the new copied solution. Adding a new resx gives the message you report. In addition, if you double click on the resx you obtain

this

  1. Rename a resx file from Solution explorer and you have this
    res2

Renaming it again solves 2, but this error message keeps popping up.

Perhaps the warning below is related to the issue while I used only the NuGet Package Manager Console to add/remove packages:
res3

@davkean
Copy link
Member Author

davkean commented Feb 10, 2017

@Ponant Can you share me the solution?

@Ponant
Copy link

Ponant commented Feb 10, 2017

@davkean , my project is fairly big, so I would rather make a new one and send it to you; jus give me some time and I will come back.

@Ponant
Copy link

Ponant commented Feb 10, 2017

BTW , it is .Net core (.Net 4.6.1)

@davkean
Copy link
Member Author

davkean commented Feb 10, 2017

@Ponant A repro project or specific repro steps would be great. Thanks!

@Ponant
Copy link

Ponant commented Feb 10, 2017

I just made it.

  1. Console App Core (4.6.1)
  2. No update for Nuget
  3. Right click Solution explorer-->new Item-->resource file, name and create

Output:

  1. "Custom tool ResXFileCodeGenerator failed to produce an output for input file ... but did not log a specific error.". Project is ASP.NET Core on .NET

  2. Rename the file and you get my second pic above

I have to leave in a few minutes so I am not sure I can send it up, let me know if you can repro

@Ponant
Copy link

Ponant commented Feb 10, 2017

It seems to be with a webapp template (empty is enough), no issue with a console app so far

@Ponant
Copy link

Ponant commented Feb 10, 2017

@davkean
Copy link
Member Author

davkean commented Feb 10, 2017

Thanks!

@davkean davkean modified the milestones: 1.0 RTM, 1.1 Feb 10, 2017
@davkean davkean added the Blocking-Release We cannot ship the current milestone without this feature. label Feb 10, 2017
@Ponant
Copy link

Ponant commented Feb 10, 2017

could you reproduce? cheers!

@davkean
Copy link
Member Author

davkean commented Feb 10, 2017

I haven't tried yet, won't be able to look at this until next week.

@davkean
Copy link
Member Author

davkean commented Feb 13, 2017

@Ponant Does your project look like this:
image

@davkean
Copy link
Member Author

davkean commented Feb 13, 2017

Okay, investigated my issue above, and it's due to #1538.

@davkean
Copy link
Member Author

davkean commented Feb 13, 2017

Also filed #1539 to track rename, trying to track the other two issues that you called out.

@davkean
Copy link
Member Author

davkean commented Feb 13, 2017

@Ponant Okay, in summary I can repro two bugs with the solution you provided me:

  1. Renaming a RESX (or rather any item with metadata) displays an error: Renaming an item with update metadata displays an errors, and loses metadata #1539.
  2. Moving a project on disk breaks IntelliSense: Moving a project on disk breaks IntelliSense, etc due to caching of targets #1538.

I cannot repro:

  1. Object instance not set an instance of an object when opening a RESX
  2. "Custom tool ResXFileCodeGenerator failed to produce an output for input file ... but did not log a specific error"

Can you repro these two issues consistently with a fresh project?

@Ponant
Copy link

Ponant commented Feb 13, 2017

@davkean I can definitely confirm the existence of 1 (Object instance not set an instance of an object when opening a RESX). I have 3 projects which display this form since one week, so the only way to edit or view the resx is to open it with notepad or the like. The other one happened just yesterday.

@Ponant
Copy link

Ponant commented Feb 13, 2017

It is hard to tell you how to make it happen. For instance, as I downloaded the very same project I gave you, I could open the file and no error showed up, which is wierd.
Perhaps the following can help:

  1. open 2-3 projects simultaneously
  2. create resx's and edit and rename them. VS seems to panic whenever I put a dot in the name of the file.

I can send you one resx that has issue 1, if you want, but I am not sure this will help.

@Ponant
Copy link

Ponant commented Feb 13, 2017

I added 4-5 resx's from another project and all display "Object instance not set an instance of an object when opening a RESX"

@davkean
Copy link
Member Author

davkean commented Feb 13, 2017

Thanks, I'll try against tomorrow. Failing that I might have to get you to attach to VS itself and capture the stack when it occurs.

@davkean
Copy link
Member Author

davkean commented Feb 14, 2017

Okay, I spent another hour on this trying to repro. I can now repro the second error "Custom tool ResXFIleCodeGeneator failed to produce an output for input file" and filed: #1553.

I still cannot, no matter how many projects and different project types, resx's I create, rename, include "." in their names, repro the "object instance not set to an instance of a open when opening a RESX".

If you can consistently repro this, can I ask you to do the following:

  1. Start another instance of Visual Studio
  2. Choose Debug -> Windows -> Exception Settings
  3. Uncheck the checkbox next to Language Runtime Exceptions
  4. Expand it, and check System.NullReferenceException
  5. Choose Debug -> Attach to Process
  6. Choose devenv.exe, make sure you've selected Managed (v4.6, v4.5, v4.0) code
  7. Click Attach
  8. In the other VS instance, repro the bug
  9. When VS breaks in the debugger, Copy the stack from Call Stack window and paste it here.

@Ponant
Copy link

Ponant commented Feb 14, 2017

@davkean I will strip out a project and send it to you.
Here is what I find in csproj, a file which does not exist (but reminiscent of a copy paste)
<EmbeddedResource Update="Resources\Controllers - Copy.HomeController.fr-FR.resx">

@Ponant
Copy link

Ponant commented Feb 14, 2017

@davkean ok go and have a beer and I will do it today, cheers

@Ponant
Copy link

Ponant commented Feb 14, 2017

@davkean , before doing what you want, can you clone and double click on the res files there?
https://github.com/Ponant/ResBugV2

@davkean
Copy link
Member Author

davkean commented Feb 14, 2017

There's no code in that repo. :)

@Ponant
Copy link

Ponant commented Feb 14, 2017

done, I removed controllers and unnecessary stuff and I see the bug appearing, try it out, otherwise I will Stack

@davkean
Copy link
Member Author

davkean commented Feb 14, 2017

@Ponant Awesome I got something - from initial reports it looks like #1499.

@Ponant
Copy link

Ponant commented Feb 14, 2017

So what, we are done?

@davkean
Copy link
Member Author

davkean commented Feb 14, 2017

You can pull the repo now I have the source, still debugging - want to absolutely confirm that it's the underlying cause.

@Ponant
Copy link

Ponant commented Feb 14, 2017

I deleted the services folder and close the solution and restart and now I can open the resx again. Funny.

@davkean
Copy link
Member Author

davkean commented Feb 14, 2017

Yeah, similar to #1499 - but it's not. Looks like the References are in a bad state and we're null-referring on accessing them.

@Ponant
Copy link

Ponant commented Feb 14, 2017

ok happy to contribute to the mess, cheers

@davkean
Copy link
Member Author

davkean commented Feb 14, 2017

Actually, can you keep that code around? I'm seeing a few other issues as well that I'd like us to fix.

@davkean
Copy link
Member Author

davkean commented Feb 14, 2017

I'm going to close out this issue, in summary, thanks to @Ponant we got the following bugs from this:

#1538
#1539
#1553
#1555

Also was running into:
#939

@davkean davkean closed this as completed Feb 14, 2017
@Ponant
Copy link

Ponant commented Feb 14, 2017

Sure, I will leave them

@Ponant
Copy link

Ponant commented Jun 28, 2017

somewhat related dotnet/aspnetcore#2075

@olivierr91
Copy link

olivierr91 commented Oct 19, 2017

My "Error List" window gets consistently filled with this error with every .resx file I create in Visual Studio 2017 15.4.1 and .NET Core 2.0. The project builds successfully, but right-clicking a "resx" file and selecting "Run Custom Tool" produces the error. This issue should be reopened.

untitled

@bill-call
Copy link

bill-call commented Nov 1, 2017

I am getting the same problem. I have, in the past tried to move this solution to a different directory, but then moved it back to it's original location. Based on the history, that may be relevant.

Microsoft Visual Studio Community 2017
Version 15.4.1
VisualStudio.15.Release/15.4.1+27004.2005
Microsoft .NET Framework
Version 4.7.02558

Installed Version: Community

Visual Basic 2017 00369-60000-00001-AA555
Microsoft Visual Basic 2017

Visual C# 2017 00369-60000-00001-AA555
Microsoft Visual C# 2017

Visual C++ 2017 00369-60000-00001-AA555
Microsoft Visual C++ 2017

Visual F# 4.1 00369-60000-00001-AA555
Microsoft Visual F# 4.1

Application Insights Tools for Visual Studio Package 8.9.00809.2
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2017 15.0.30925.0
ASP.NET and Web Tools 2017

ASP.NET Core Razor Language Services 1.0
Provides languages services for ASP.NET Core Razor.

ASP.NET Web Frameworks and Tools 2012 4.0.20601.0
For additional information, visit https://www.asp.net/

ASP.NET Web Frameworks and Tools 2017 5.2.50921.0
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 15.0.30915.0
Azure App Service Tools v3.0.0

Azure Data Lake Node 1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio 2.3.0000.1
Microsoft Azure Data Lake Tools for Visual Studio

Azure Data Lake Tools for Visual Studio 2.3.0000.1
Microsoft Azure Data Lake Tools for Visual Studio

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Cookiecutter 3.0.17262.1
Provides tools for finding, instantiating and customizing templates in cookiecutter format.

Dotfuscator Community Edition 5.30.0.5167-c98e2f8
PreEmptive Protection - Dotfuscator CE

Fabric.DiagnosticEvents 1.0
Fabric Diagnostic Events

GitHub.VisualStudio 2.2.0.10
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

JavaScript Language Service 2.0
JavaScript Language Service

JavaScript Project System 2.0
JavaScript Project System

Merq 1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft Azure HDInsight Azure Node 2.3.0000.1
HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service 2.3.0000.1
Language service for Hive query

Microsoft Azure Service Fabric Tools for Visual Studio 1.8
Microsoft Azure Service Fabric Tools for Visual Studio

Microsoft Azure Stream Analytics Language Service 2.3.0000.1
Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node 1.0
Azure Stream Analytics Node under Azure Node

Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.50719.1

Microsoft Continuous Delivery Tools for Visual Studio 0.3
Simplifying the configuration of continuous build integration and continuous build delivery from within the Visual Studio IDE.

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards 1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio VC Package 1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio 4.7.4-pre (c2d89eb)
Support for debugging Mono processes with Visual Studio.

Node.js Tools 1.4.10918.1
Adds support for developing and debugging Node.js apps in Visual Studio

NuGet Package Manager 4.4.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Python 3.0.17262.1
Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.

Python - Django support 3.0.17262.1
Provides templates and integration for the Django web framework.

Python - IronPython support 3.0.17262.1
Provides templates and integration for IronPython-based projects.

Python - Profiling support 3.0.17262.1
Profiling support for Python projects.

SQL Server Data Tools 15.1.61707.200
Microsoft SQL Server Data Tools

ToolWindowHostedEditor 1.0
Hosting json editor into a tool window

TypeScript 2.3.5.0
TypeScript tools for Visual Studio

Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio tools for CMake 1.0
Visual Studio tools for CMake

Visual Studio Tools for Unity 3.4.0.2
Visual Studio Tools for Unity

VisualStudio.IoT 1.0
Package with IoT components for Visual Studio

VisualStudio.Mac 1.0
Mac Extension for Visual Studio

WebJobs Tools v1.0.0 15.0.30923.0
WebJobs Tools v1.0.0

Xamarin 4.7.10.22 (fe36bec)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK 8.0.0.33 (HEAD/7a6a056e8)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK 11.2.0.8 (9a9f054)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

@bill-call
Copy link

Opened #2934.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocking-Release We cannot ship the current milestone without this feature. Bug This is a functional issue in already written code.
Projects
None yet
Development

No branches or pull requests

5 participants