![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | More on the renaming of MyApp to something more descriptive - anotherpainful bug Ok, this is an even more frustrating one. I'd like to put my main Application class in a different package than the one which it was originally created in. For example, I create a new solution in VS. Let's say that the namespace is MyNamespace and the files are MyApp.xaml and MyApp.xaml.cs. Now I'd like to put them into a namespace called CorrectNamespace, and also put them in a matching folder hierarchy. I create a folder called CorrectNamespace and drag MyApp in there. I also drag Window1.xaml in there. Then I go into the source files and rename the namespaces accordingly (which I shouldn't even have to do!). A build and run attempt will give you the following error currently: Error 2 Program 'C:\Documents and Settings\jdolinger\My Documents\Visual Studio\Projects\WPF Demos\DefaultNamespace\DefaultNamespace\obj\Debug\DefaultNamespace.exe' does not contain a static 'Main' method suitable for an entry point DefaultNamespace This is because now that I moved MyApp, the VS/WPF does not recognize it as an application, it thinks it's a window, which is the previous bug I reported on. So as the fix to that, I fix the markup in the .csproj file to change it from a "Page" tag to "ApplicationDefinition." However, any further attempts to run the program result in this error: Error 1 Source file 'C:\Documents and Settings\jdolinger\My Documents\Visual Studio\Projects\WPF Demos\DefaultNamespace\DefaultNamespace\obj\Debug\MyApp.g.cs' could not be opened ('The system cannot find the file specified. ') DefaultNamespace VS is clearly looking for MyApp.g.cs right under the Debug folder, rather than "Debug\CorrectNamespace\MyApp.g.cs" I can track this to the following line in the .csproj.FileList.txt file: C:\Documents and Settings\jdolinger\My Documents\Visual Studio\Projects\WPF Demos\DefaultNamespace\DefaultNamespace\obj\Debug\MyApp.g.cs I can temporarily fix the problem by deleting that file, or removing that line from the file, but it always gets regenerated after a single run, and I start getting the error again. Can anyone at MS provide a workaround for this one, or some further explanation? Regards, Jason |
My System Specs![]() |
| | #2 (permalink) |
| | RE: More on the renaming of MyApp to something more descriptive - anot Regarding not automatically renaming the namespaces inside a source file after moving the file to a different folder, that is by design. Namespace and folder structure don't need to match. Regarding the issue with the .csproj.FileList.txt file having the wrong path, I haven't been able to repro that. If you could provide the full project, I can investigate the issue further. -- -- - Daniel Marley [MSFT] -- This posting is provided "AS IS" with no warranties, and confers no rights. "Jason Dolinger" wrote: > Ok, this is an even more frustrating one. I'd like to put my main > Application class in a different package than the one which it was > originally created in. For example, I create a new solution in VS. > Let's say that the namespace is MyNamespace and the files are MyApp.xaml > and MyApp.xaml.cs. > > Now I'd like to put them into a namespace called CorrectNamespace, and > also put them in a matching folder hierarchy. I create a folder called > CorrectNamespace and drag MyApp in there. I also drag Window1.xaml in > there. Then I go into the source files and rename the namespaces > accordingly (which I shouldn't even have to do!). > > A build and run attempt will give you the following error currently: > > Error 2 Program 'C:\Documents and Settings\jdolinger\My Documents\Visual > Studio\Projects\WPF > Demos\DefaultNamespace\DefaultNamespace\obj\Debug\DefaultNamespace.exe' > does not contain a static 'Main' method suitable for an entry point > DefaultNamespace > > This is because now that I moved MyApp, the VS/WPF does not recognize it > as an application, it thinks it's a window, which is the previous bug I > reported on. So as the fix to that, I fix the markup in the .csproj > file to change it from a "Page" tag to "ApplicationDefinition." > However, any further attempts to run the program result in this error: > > Error 1 Source file 'C:\Documents and Settings\jdolinger\My > Documents\Visual Studio\Projects\WPF > Demos\DefaultNamespace\DefaultNamespace\obj\Debug\MyApp.g.cs' could not > be opened ('The system cannot find the file specified. ') DefaultNamespace > > VS is clearly looking for MyApp.g.cs right under the Debug folder, > rather than "Debug\CorrectNamespace\MyApp.g.cs" > > I can track this to the following line in the .csproj.FileList.txt file: > > C:\Documents and Settings\jdolinger\My Documents\Visual > Studio\Projects\WPF > Demos\DefaultNamespace\DefaultNamespace\obj\Debug\MyApp.g.cs > > I can temporarily fix the problem by deleting that file, or removing > that line from the file, but it always gets regenerated after a single > run, and I start getting the error again. > > Can anyone at MS provide a workaround for this one, or some further > explanation? > > Regards, > Jason > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: More on the renaming of MyApp to something more descriptive -anot Daniel Marley [MSFT] wrote: > Regarding not automatically renaming the namespaces inside a source file > after moving the file to a different folder, that is by design. Namespace and > folder structure don't need to match. > > Regarding the issue with the .csproj.FileList.txt file having the wrong > path, I haven't been able to repro that. If you could provide the full > project, I can investigate the issue further. > Thanks, Daniel. Could you contact me with an address to send you the code? |
My System Specs![]() |
| | #4 (permalink) |
| | Re: More on the renaming of MyApp to something more descriptive - As we followed up via email, I confirmed the issue in the December CTP bits, and it appears that issue is addressed in current private bits. -- -- - Daniel Marley [MSFT] -- This posting is provided "AS IS" with no warranties, and confers no rights. "Jason Dolinger" wrote: > Daniel Marley [MSFT] wrote: > > Regarding not automatically renaming the namespaces inside a source file > > after moving the file to a different folder, that is by design. Namespace and > > folder structure don't need to match. > > > > Regarding the issue with the .csproj.FileList.txt file having the wrong > > path, I haven't been able to repro that. If you could provide the full > > project, I can investigate the issue further. > > > > Thanks, Daniel. Could you contact me with an address to send you the code? > |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| MyApp.exe.config vs MyApp.config | .NET General | |||
| Renaming A DVD Drive? | Vista General | |||
| Renaming a file | Vista file management | |||
| Renaming Bug | Vista General | |||