Bug 59324 - Refactoring namespace then rebuild cause error
Summary: Refactoring namespace then rebuild cause error
Status: RESOLVED INVALID
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android ()
Version: 4.6.0 (15.3)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-09-08 10:14 UTC by wgt
Modified: 2017-09-09 09:02 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description wgt 2017-09-08 10:14:40 UTC
In VS2015 update 3 on windows 10 x64,create a Visual C#->Android->Single View App(Android) project,then in MainActivity.cs,refactor the namespace ,then rebuild ,then misc strange errors(can't find Resource.Id,etc) appear.Only way to clear the error is rename to the original namespace.
Comment 1 wgt 2017-09-08 10:17:38 UTC
You have to rebuild to get the error,only build won't trigger the error.
Comment 2 Prashant [MSFT] 2017-09-08 12:46:21 UTC
This works as expected[*]. When you rename the namespace in the MyActivity it will change it only for that class, notice the rename prompt in the screenshot

There are two options to fix this
1. Rename all namespaces in the projects 
2. add `using <old_namespace>;` on top of the file


* https://www.dropbox.com/s/ne23txh68f798vs/Screenshot%202017-09-08%2019.35.52.png?dl=0
Comment 3 wgt 2017-09-09 09:02:53 UTC
Yes,thanks.
BTW,when I get into "My Bugs",this invalid/solved bug is not there,and I can't find ti by searching on the search box top of the page,only get into this bug again by creating a new bug and enter the key word and the search engine there bring out the bug.
Why not listing all my bugs in My Bugs?