Workflow Foundation: Designer is not working - visual-studio-2010

When I try to open any activity in design mode designer fails with message "The document contains errors that must be fixed before the designer can be loaded. Reload the designer after you have fixed the errors". The project builds and runs fine though. This happens even with a fresh newly created solution. I mean that if I create a new workflow project and add a new item -> activity the problem persists.
If I click "Reload the designer" I get the following error: "Undefined CLR namespace. The 'clr-namespace' URI refers to a namespace 'System' that is not included in the assembly". If I build the project the error disappears but the designer doesn't start working.
I'm using VS2010 Premium. The only plugin installed is ReSharper. However I tried removing it but it didn't solve the problem. I've also asked a friend of mine to reproduce the same error on his computer but everything worked well.

The problem was that there are several types of editor for .xaml files. If you right click open with you can choose one of them. In my case WPF designer was selected by default though it's better to choose automatic selection.
Hope this information will be helpful for someone else :)

Related

Opening existing project in Delphi 10.2 reports error that "Class TBarSeries not found."

This is a strange one, and is related to the Delphi IDE environment, but I'm hoping someone has some insight, cos I'm at a loss.
Basically, the problem is that I'm now in a situation where any project I create that uses a TChart with a TBarSeries gives me the "Class TBarServices not found" error when I re-open it from a fresh start of the IDE.
As an example, currently if I do the following:
Create a new VCL forms application,
add a TChart component to the form,
edit the chart through the designer and add a Series, choosing Bar as the type.
Build the project,
run it, everything is fine.
Close the IDE and restart it.
Open the previously saved project. Immediately get the Error Reading Form message about Class TBarSeries not found.
But if I then:
Close the broken project without saving, and leave the IDE running.
Create a new VCL form with or without a project,
add the TChart and bar Series to the form,
close the form/application without saving.
Reopen the previously saved project that threw the error. No error any more.
Creating a new TForm with a TChart and TBarSeries is changing the Delphi IDE in some way that is not persistent, so that the next time the IDE is started, those projects no longer load properly.
I have included VCLTee in the Unit Scope Names, but the Enterprise version of Delphi 10.2 does not include the source for these components, so there are no additional paths I can add to the Library Path.
Once I have created a new form and set up the chart, everything is fine with any project that uses the TBarSeries so long as I don't close the IDE, so that's the workaround I currently employ.
Do you use DevExpress?
I had the same problem when DevExpress Printing System for DBTeeChart was installed.
Probably DevExpress uses old version of TeeChart different than this installed by you.
I just disabled this DevExpress Printing System and now it's OK.

Visual Studio 2017 cannot build blank app after disabling/reenabling xaml designer?

I am trying rebuild a C++/winrt app by beginning with the BlankApp1 that is created by VS2017 - at first the blankapp built and ran just fine, but then I tried disabling xaml designer using the disable switch in tools/options/xaml (I prefer not to use the designer). However, the original sample xaml files remained, so the sample interface remained. I tried deleting the xaml files, after which nothing would build. Finally I trashed the whole blankapp directory, turned xaml designer back on in VS, restarted VS, and now have tried twice to create and run new BlankApps without changing anything in them. I get build errors: "Cannot open include file 'XamlMetaDataProvider.g.h' (compiling source file GeneratedFiles\XamlTypeInfo.Impl.g.cpp)" Does anyone know what to change in VS to make it functional again? And if I want to disable designer, is it enough to turn it off in options, or do certain files also need changing?
I think I know how to make it build and run, though I haven't yet succeeded in programmatically adding xaml elements as I had done with a previous app. Here's what makes the blankapp compile and run with the xamldesigner disabled: (1) Use the switch in Tools/Options/Xaml to turn off the designer, then restart Visual Studio. (2) Find the mainpage.idl and insert this declaration:
runtimeclass XamlMetaDataProvider : Windows.UI.Xaml.Markup.IXamlMetadataProvider
{
XamlMetaDataProvider();
};
That seems to be the missing step required if the designer gets turned off. I hope someone will correct me if I'm mistaken, but this appears to do the trick.
[Update] In Visual Studio 15.9.0 Preview 3, now with support for xaml designer in C++/winrt apps, I cannot find a way to use the complex and dynamic xaml interface I had created programmatically in the previous VS. I may have to post a new and separate question about this: is it still possible to programmatically add xaml elements?

How to solve Intellisense not working in VS 2010

I am opening files from a server ASP.net and the VB codebehind files, and my visual studio is not working correctly, Intellisense is dead and if i right click the "Go to defenition" option is disabled. These files are not part of a solution.
This is strange though because it was working properly yesterday. If I create a new project the intellisense works great, yet opening this single file it fails.
I have tried to re enable intellisense by resetting visual studio, I tried editing the text editor settings so that Auto list members and Parameter information are both checked. I even tried installing ReSharper and nothing worked. I have rebooted twice and even tried copying the file to a local drive to work on yet nothing.
Does anyone know why this is happening and what I could do to solve the problem? Im working on a rather complex problem and intellisense would make it a lot easier.
I managed to fix this problem which manifested itself after my ReSharper trial expired.
Steps to fix are:
Tools/Import and Export Settings
Reset all settings
Back up your config
Select your environment settings and finish
Intellisense started working again straight away.
For me simply hitting Ctrl+Alt+Space to re-enable Autocompletion fixed it.
I had the same problem. It only affected one of my solutions. Others seemed fine.
To correct it I deleted the solution's user options file (.suo).
When I opened the solution again, intellisense was working.
For the benefit of searchers, Nicks suggestion is good, but if you don't want to reset all your settings, you could follow the recommendation in this post.
It states - "go to "Tools | Options | Text Editor | C# | General and check the "Auto list members" and "Parameter information" checkboxes"
I should first note that upgrading my RAM from 4 to 16GB seems to have made this issue go away.
Here's the steps I go through:
If only one file/window appears to be affected, close/reopen that file. If that doesn't work, try below.
In Visual Studio:
Click Tools->Options->Text Editor->All Languages->General
Uncheck "Auto list members"
Uncheck "Parameter information"
Check "Auto list members" (yes, the one you just unchecked)
Check "Parameter information" (again, the one you just unchecked)
Click OK
If this doesn't work, here's a few more steps to try:
Close all VS documents and reopen
If still not working, close/reopen solution
If still not working, restart VS.
For C++ projects:
MSDN has a few things to try: MSDN suggestions
The corrupt .ncb file seems a likely culprit.
From MSDN:
Close the solution.
Delete the .ncb file.
Reopen the solution. (This creates a new .ncb file.)
Sometimes, it could be because of different extension style that you are using for the files.
In my case Intellisense is working in all the files except for a file in a different project of the same solution.
When I have changed the extension of the file to cxx from cpp,it started working.
The includes and other files in the solution are of extension .cxx or .txx.
Thank you
Save your solution. Closing the VS2010 instance for this solution and re-oprning worked for me.
Here I assume that Intellisense was working OK but stopped for some unknown reason without changing any default settings.
Prabhdeep
After uninstalling ReSharper, the squigglies that show up underneath a syntax error stopped showing up in the code editor.
This blog post helped me fix the issue.
Try this:
Close any open instances of visual studio, delete the folder 10.0 inside `C:\Users[username]\AppData\Roaming\Microsoft\VisualStudio\' and restart the visual studio. Issue will be fixed.
In my case, none of the above worked (although I discovered that sometimes the *.suo file is the trouble maker - in those cases deleting it helps).
I fixed it successfully the following way: Let's assume your solution has the name MySolution. Do the following:
Reset the settings (as described here). Close Visual Studio 2012.
Locate the file MySolution.sln.DotSettings (it is in the same folder as your MySolution.sln file)
Rename or delete it (for example rename it to XMySolution.sln.DotSettingsX so VS won't read it)
Open your solution by double-clicking on the MySolution.sln file
And afterwards Intellisense was working again just fine. I assume the file MySolution.sln.DotSettings got corrupted.
Note: The file MySolution.sln.DotSettings was created and checked in to TFS by a team colleague who had installed ReSharper. The issue occurred on a different PC without ReSharper where the same project was opened.
For me, this was related to an incorrect xaml file build action in an Azure WorkerRole project (bizarre, though it may seem!). Please see my entry in this post if you want to know more:
C# VS2010 Entering break mode failed
The fix for the error in the above thread also resulted in the intellisense starting to work again.
I fixed this problem by removing Sybase Power Designer VS extension.
You can try to disable other extensions.
Exactly the same issue, though would appear only on certain projects (even within a single solution).
Removing the *.*proj.user file (e.g. *.csproj.user) for the projects in question properly reset the missing features ("Go To Definition", "Organize Usings", Intellisense on certain types, etc).
In our case, I suspect this happens sometimes when we switch branches with an SCM that uses a single working directory (like git). If setup properly, it wouldn't track *.user* files but that means that if there are incompatible changes in it across different branches, you need to regenerate it.
So of course the "sometimes" would depend on the current branch and the next branch.
Unfortunately I don't see a very good solution if that's the case. Sometimes you really want to keep the user settings across branches if they're compatible, sometimes you want to regenerate them unconditionally. Ideally, you might even want to only change parts of them when switching, while keeping other parts.
If you never need to keep them and are fine with regenerating them every time, then you can configure your SCM to always remove these files while switching branches (e.g. using hooks for git). This is a pretty naive solution however, doing it more universally correctly would require a smarter system (aware of the semantics behind the .user files and capable of capturing/prompting user intent when needed).
save, close and reopen the source file you are working on. This works every time for me.
Try to add the statement:
<%# Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="IP_Updater.Default" %>
...at beginning of your page. The above example is applied for page Default.aspx written in VB.NET.
This is the problem related to Microsoft MSDN , your MSDN might be getting some problem. The solutions to this is uninstall MSDN and then re-install . before going for this make sure that you system is free from virus attack.
Hope that after doing , the Microsoft Intellisense will start running

Visual Studio 2010 Designer Bug: Unable to copy from obj\debug to bin\debug

Wondering if anyone has a solution to this 2010 bug. I have a project that built fine in Visual Studio 2008 that wont build in 2010 because Visual Studio is holding on to the dll after the application is run ONLY if a designer window is open. I created a really light weight project that shows this problem. If you create an application then create a lib dll. Put one form in the dll, open the form in design view and then run the application. It will run fine, then close the app, go to the code view of the form in design view, and change the code ( I just renamed a single variable) then try to recompile you get the following:
Error 1 Unable to copy file "obj\Debug\customlib.dll" to "build\debug\customlib.dll". The process cannot access the file 'build\debug\Customlib.dll' because it is being used by another process.
If you run Process Explorer and search for the dll, the only process holding the dll is devenv.exe!!!
I have done a ton of searching on this problem and have found similar issues with older versions of Dev Studio where people were able to just add a pre-step to move the locked dll to another name (.locked) and build. Well that works the first time, but the next time you run then edit you are locked out of both the current dll and the one you moved to .locked, so unless I am willing to add code to randomly generate a name for the locked dll, this wont work for me (I don't want my debug directory size to grow with files never getting deleted.)
I have only found one workaround and if you are in this same boat this is what I have to do to edit and run. I make sure EVERY design view window is closed BEFORE I ever run my project in the debugger. If you close all the open design view windows devenv.exe will not hold the dll.
Does anyone have a better solution to this problem?
I'm not sure whether this will work for you or not, but this similar question if you have this line in AssemblyInfo.cs:
[assembly: AssemblyVersion("2.0.*")]
changing it to:
[assembly: AssemblyVersion("2.0.0.0")]
will solve this isue.
The Visual Studio add-on "VSCommands" claims to have a fix for this problem. I've not tested it yet, but it also claims to have an in-IDE stackoverflow reputation tracker which intrigues me :)
Your "Close designer before debugging" workaround seems to be working for me (so far), for which I'm very grateful. It was beginning to get to the stage where am large part of my day was spent in the following workflow...
F5
loud expletive
ALT F4
WIN 3
waits impatiently...
F5
I have had the same problems for a long time and then suddenly they disappeared. I realized that the source of the problems was initializing code in the constructors of WCF services and WPF controls. After cleaning the constructors from any dependencies to other assemblies everything has been fine.
So my suggestion is: Clean your constructors.
In WPF it is possible that inserting:
if (DesignerProperties.GetIsInDesignMode(this)) return;
or similar will have the same effect.

generation of designer file failed

Every few days VS2008 decides to get mad at me and fails to generate a designer file claiming it cannot find the file specified and that it's missing an assembly. Here's the scenario:
The aspx page has a reference to a custom user control (inheriting UserControl) which references another assembly in the backend. There are many other references to this "missing" assembly in other places in code which don't throw errors. rebuilding, updating the source to the clean copy, shouting at the computer, punching the screen, etc all fail to work.
Any suggestions? This is quite annoying.
We've had similar problems before, unfortunately I don't remember the exact solution.
If your using a "Web Site" project (no project file) then start by checking that both your page and your control both set the ClassName property in the first line of your aspx/ascx file and that you specify the full name of the class including the namespace.
Example:
<#Control Language="VB" AutoEventWireup="false"
ClassName="YourProjectName.YourUserControl"
Inherits="YourProjectName.YourUserControl"
CodeFile="YourUserControl.ascx.vb"
%>
Many times not setting all of these will still work but you will get odd compiler errors and behavior in VS.
If you using a Web Site Application project try deleting the designer file manually and then right click on your project and choose "Convert from Web Application." This will should recreate the designer file for you.
My only other suggestion would be to recreate the page and/or the user control from scratch.
Jared, you've hit it. Using "Convert to Web Application" to manually generate the designer file solves my problem. I'm glad you posted this before i started reinstalling. Thanks.
You might try archiving a template of a new file with its designer equivalent. If VS coughs then you can do an "Add Existing" option with the file you already have.
It seems, however, to be an issue with your installation of VS2008 so you might try reinstalling it.
I found that using a custom control, you would need to add a reference to the .dll. This fixed it for me after migrating from a web site to web app.

Resources