Beginner here. I'm trying to move over to C# for the future, so I want to convert my main project to it. I'm tried using SharpDevelop 4.4, but after converting attempting to open my forms in Visual Studio results in:
To prevent possible data loss before loading the designer, the following errors must be resolved:
The designer could not be shown for this file because none of the classes within it can be designed.
and the error:
Instances of this error (1)
1. Hide Call Stack
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager manager)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)
Is there a way I can manually convert the files? I know there are code converters online, but I have no idea how you would change the entire solution.
Edit: Getting this error after trying to run the program:
Error 5 The OutputPath property is not set for project 'Skype.Converted.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='AnyCPU'. This error may also appear if some other project is trying to follow a project-to-project reference to this project, this project has been unloaded or is not included in the solution, and the referencing project does not build using the same or an equivalent Configuration or Platform. Skype.Converted
And an info message:
Message 4 The designer could not be shown for this file because none of the classes within it can be designed.
I would recommend this code converter, as it's the one I've used when I've only been able to find solutions to my answers in C# and need them in VB.
I'm sure you could use it for the reverse action to manually convert your code.
Link: http://converter.telerik.com/
As far as the designer bits are concerned, I'm relatively certain you can select all of your controls on one project, copy, and then paste them onto the other project. Re-associating them with their functions/handles will be annoying though.
Related
I'm trying to maintain an application that contains the following line in several different files:
using Microsoft.AspNet.Membership.OpenAuth;
I've tried everything I could find. Removed and re-added the reference; cleared the MEF cache and rebuilt; added a different file as a reference. Nothing works. It's bizarre because VS2017 doesn't report this error in the Error List window, but it does show up in the Output window. Anyway, can someone please suggest a possible solution that maybe I haven't tried yet? Thanks.
I was able to compile the project and I will describe how I got it.
1 - I delete all using Microsoft.AspNet.Membership.OpenAuth; and build project.
2 - After build the code show many errors I use the resource of VS2015 help fixes errors on code Show potential fixes and set again using Microsoft.AspNet.Membership.OpenAuth; build project.
3 - Set a new framework 4.6 and build project.
https://drive.google.com/open?id=0B4aywYtmwk6lT1dDNnIxRmtQcUk
I'm getting this problem building a WPF project
The name does not exist in the namespace
Everything I’ve looked at says you should
Change the namespace and the project name, build, change them back
Change the build from 86 to 64, build, and back Tried removing the
reference and letting ReSharper re-instate the reference Tried
excluding the file, build, then include the file again
None of the above worked.
I have checked that each referenced class has only one instance of it throughout the whole solution – ruling out named duplicates
The references in question are all references within the one DLL – all namespaces within this dll so it’s not like there is a cross dll issue of any sort.
Your thoughts or suggestions at this point are appreciated.
I to assume that You have this error in XAML file.
I thing it is very common problem with WPF and Visual Studio 2015.For example I have this error when I use DevExpress dlls
My suggestions is to try this:
Restart Visual Studio - it is weird but frequently it works. I don't now way it works.
Use F5 and run the program instead of build them (F6). Sometimes when You compile app the error disappear and app runs. It is also weird, but in my case it works
This not resolve the problem but it helps exclude the problem with IDE
I'd like to keep my Windows Phone 8 Blank App template based view in a different assembly than the assembly containing the application manifest and App.xaml.
I keep receiving a cryptic exception which doesn't help at all in figuring out how to fix it:
Create a new project from the template Visual C# > Store Apps > Windows Phone Apps > Blank App (Windows Phone).
Build and deploy, works great. The properties of the MainPage.xaml state the Build Action is Page, which is correct.
Create a new project based on the Class Library (Windows Phone) template from the same category within the solution containing the original project, call it MyApp.Views.
Move the MainView.xaml file to the newly created project using Cut and Paste commands.
Add a reference to MyApp.Views to the original project.
Build, deploy, see the app start and fail to locate the view only to propagate this exception back to the developer's box: ComException: Error HRESULT E_FAIL has been returned from a call to a COM component. This doesn't say absolutely anything at all useful and the top stack frame is Windows.UI.Xaml.Controls.Frame.Navigate(Type sourcePageType, Object parameter) following the first one, which is TheOriginalProject.App.OnLaunched(LaunchActivatedEventArgs e).
The solution is not to use NavigationService with pack URI since it seems to be absent in Windows Phone 8, or at very least the assembly containing it is not referenced by default in the Blank App template. In any event, I'd vastly prefer strongly typed view names over pack URIs.
I imagine someone must've run into this issue already, what's the catch? Is there an API or a tool that will give me an insight on what the latest E_FAIL coming from COM is?
Edit: When using Window.Current.Content = new MainPage() as the only content of OnLaunched, the XAML parser exception pops up. It is unable to populate an exception message, but definitely gives a better hint to what's going on. Still no solution, though, the problem only moved to the this.InitializeComponent() in the MainPage constructor.
What I see now is Windows.UI.Xaml.Markup.XamlParseException with WinRT information of Parser internal error: Object writer '%0' and Additional information unable to load. x:Class attribute is present at the position 128 hinted on by the exception dialog window and this thread seems relevant, but I can't work out how.
Please note that I'll also find values in people confirming not receiving the error I do. If you've tried the steps to reproduce and failed to reproduce the problem, please write a comment so I can pin down what it is that causes the error I'm struggling with.
Alternative solution to externalizing views to a separate project while avoiding this problem is to use a Shared project project type, put the views there and reference it from the main project.
This does not produce a separate assembly for the views, instead the files are just grouped within their custom project, but behave as if they were part of the main project during compilation. The error goes away because from the compiler point of this, there's no difference between a file in a shared project and a file directly in the main project. During runtime, the type of the view doesn't need to be resolved from a different assembly, it's right there in the same assembly.
Using Visual Studio 2010 to build a setup project that installs a Windows Forms application .Net 4.0 C#. It has worked fine for ages but now when I'm trying to install the finished setup file, I'm getting this error message:
Error 1001. Unable to get installed types in the "Path" assembly. -->
Unable to load one or more of the requested types. Retrieve the
LoaderExceptions property for more information.
I have been searching for answers for over 4 hours now without finding anything. This problem just came without me doing anything. Last time I build the install file was like 2 weeks ago and there was NO problem at all. I haven't deleted any reference or any code that have anything to do with the setup project.
How could this problem appear from nothing and more important, how do I fix it?
Based on the error message in your second comment, it appears that your SysDir.exe assembly has been added as a Custom Action with the InstallerClass property set to true, but either no installer classes could be found in the exe or the exe could not be loaded due to missing dependencies.
You can see the list of Custom Actions by right-clicking on the installer project, selecting View and then Custom Actions.
If your exe does not can an installer class, then you can remove it from the list of custom actions.
If it does contain an installer class, then the issue is going to be missing dependencies. If fuslogvw doesn't work for you (it has always helped resolve this kind of issue for us), you can carefully review the list of references in the exe's project and compare them to what is listed in the installer project.
The other trick that we use is to examine the install directory while the error message is displayed on the screen. We can often see that DLLs are missing by doing this, usually because the path was entered incorrectly in the DLL entry within the installer project or because a condition was set incorrectly.
Have the same error today. For me it was the project type of the class library.
I noticed that the pucture on the guide I was following had selected Class Library (.NET Framework) instead of just Class Library.
Creating the correct project type fixed the error.
https://nhvu1988.com/posts/how-to-create-msi-installer-using-vs-installer/
I have problem with build in VS2010. I´m trying to develop small Prism, MVVM application.
I added new project "Toolbar" to my solution "MyApp" and during the build I get following error (propably project´s dll is not created for some reason):
Error 2 Could not load referenced assembly
"C:\net\projects\MyApp\MyApp.Modules.Toolbar\bin\Debug\MyApp.Modules.Toolbar.dll".
Caught a FileNotFoundException saying "Could not load file or assembly
'C:\net\projects\MyApp\MyApp.Modules.Toolbar\bin\Debug\MyApp.Modules.Toolbar.dll'
or one of its dependencies. The system cannot find the file
specified.".
C:\net\projects\MyApp\MyApp\ResGen MyApp
I´m quite new to VS2010 and C# so I really don´t know what happend, wheter project dll is missing because of some mistake in source code or why this can even happend? I also don´t know how to find such a mistake in source code, because VS shows up only the error mentioned above. Dependenies of the project should be ok i guess, file MyApp.Modules.Toolbar.dll really doesn´t exist in any folder on my hdd.
The problem was the bad class name defined in xaml of Toolbar project (UserControl x:Class="BAD CLASS HERE").
After many googles for a similar problem where I had at one time toyed with using open office in a .net project and then all my aspx pages had the blue squiggely line saying cli_uno couldn't be found which was referenced no where and in none of my project or lib files.
I deleted all the bin folders, a dll referencing it was hiding in one of them and making vs2010 freak out.
I realize this isn't the exact solution to the above but there isn't much out there for this error and it is a head scratcher and deleting all the bin folders worked for me so it's something to try.
You provide too litle information, so I'll ask some questions (and some possible fixes):
Is the file at the specified path to begin with?
If not, is there a project you need to build to create the dll?
If there is such project, does it build the .dll where yours is looking for it -- if not, you either need to copy it by hand or set up a post-build process to do the copy automatically after each build
If there is no such project, do you have the .dll itself somewhere. If yes, you need to copy it to the correct location.
If the .dll is at the correct location, is there some protection preventing the other project to access it?