Analysis Services in Visual Studio gives error "Invalid token 'Text' at root level of document." - azure-analysis-services

For a few years I'm using Visual Studio to build an analysis services cube. So I have a solution with a Model.bim file in it. This used to work fine (though it could be slow).
Now it gives the error messages
"Invalid token 'Text' at root level of document." and "XML document must contain a root level element." I'm still able to deploy the model, but when I want to switch to Designer mode, it refuses because it thinks the syntax is not right.
Updating Visual Studio did not help. Maybe I have to change something in the properties or configuration.
Does somebody know how to fix this?

Related

Compiler error ASP.NET MVC CS1525

I have just started up a new project and seem to be getting a compiler error from one of the files generated by Visual Studio. This view is accessible and readable by the current solution and I'm not quite sure how to go about solving this.
The error message states that you have a malplaced "=" inside the "Index.cshtml"-file. Find it and remove/replace it and it should be ok!

What is causing intermittent "Object reference not set to an instance of an object" at compile time in VS 2010?

I am sorry if this is not really a coding question (it depends on if its my code causing the problem I suppose).
I have seen this question: Tracking down intermittent 'Object reference not set to an instance of an object.' error on build
However, it has not been of much help (although if you read the comments, you will see that I thought it did help for a while there).
When I try publish my website, occasionally, I will get an error with no file or line reference:
Pre-compiling Web Site
Building directory '/App_Code/'.
Building directory '/'.: Publication (web): Object reference not set to an instance of an object.
Pre-compilation Complete
------ Skipped Publish: Project X:\, Configuration: Debug Any CPU ------
I know the usual causes of "Object reference not set to an instance of an object" but this seems a bit different, isn't it supposed to be a runtime error? Not a build error?
What is weird is that it happens, seemingly at random (about 25%-33% of the time). I can try to publish it and have it fail. Then try again straight after, without changing anything and it works fine.
I started getting this error after moving some of my functions (VB.net btw) to a new file in the App_Code folder so they can be accessed by all pages of the site.
If you need any more info, please let me know.
Thanks,
EDIT: After further investigation, it seems to only happen if I try to publish the website within a few seconds of saving changes to any file within it. What could cause this?
The same error occurred for me to, I deleted the dlls of the custom controls in the web site that are already in the bin, then i published the web site, and succeeded
IF you have any custom/usercontrols in your project, they are actually running at design time and can give object ref errors. This can occur during builds too. In that case, a property is being referenced that is NOTHING and throws the error.
I had a similar problem with a Windows Form project.
Wherever I try to move a custom control on the windows form, and then try to save the form, VS2010 comes back with "Object not set to an instance of an object".
I suspected the error was deep down in the layers of abstraction in my inherited code, but couldn't work out how deep to go, without reviewing every line of code.
My solution to this problem is this.
Open up another instance of Visual Studio 2010
Menu: Debug | Attach to Process..
Search for "devenv.exe xxx YourApplicationName..." and select it
Click "Attach"
Menu: Debug | Exceptions..
Tick all the boxes in the thrown column, then "OK"
Your second instance of VS2010 is not debugging your first instance, including all the custom controls.
Return to the first instance of VS2010, and repeat the actions that caused the error in the first place, the second instance of VS2010 will break at the line of code that has the error.
You may want to look at this link there is a bug in vs2012
https://connect.microsoft.com/VisualStudio/feedback/details/749901/error-when-i-click-publish-object-reference-not-set-to-an-instance-of-an-object

activity could not be loaded because of errors in the XAML

Considering the following scenario:
Create MyCodeActivity1 with argument MyArgument1
Add this activity to a myworkflow.xaml
Rename MyArgument1 in MyCodeActivity1 to MyRenamedArgument1
If you open myworkflow.xaml, visual studio will show this error:
activity could not be loaded because of errors in the XAML
Is there a facility where visual studio can give more information about the error please?
For now I have created a small windows application that tries to execute the workflow and shows an error message if invalid. This does give a clear message. But it would be great if visual studio provided this functionality directly.
No.
Nope.
Nuh uh.
Visual Studio's refactoring can't handle change in Activity code => change in XamlAppDef XML. Its not surprising, such a chain of logic would be complex to achieve. So whenever you do this you must expect your workflows will have to be fixed. Either plan ahead, or...
Any time a workflow won't compile, or if it shows the red box of pain in the design surface, you should always right click on the workflow file, select Open With... and select the XML (text) editor. You will see the squiggly error lines and more detail about the error in this view.
I got the same error("activity could not be loaded because of errors in the XAML"), But in my case, I had created a Code Activity and used that in a State Machine. But, I found out that the defined Code Activity had not been shown in the Toolbox. It means that the Code Activity is not identifiable to Windows Work Flow.

What is the process involved in viewing a webservice in a browser from within visual studio?

I have created a new VS2008 ASP.Net Web service project, with the default name WebService1. If I right click on the Service1.asmx file and select 'View in Browser' what are the processes that go on to make this happen? I am asking because I have a situation where when I run this from a visual studio project started in our development shell (which sets up a common build environment) I cannot get the web service to show up in the browser.
It starts the asp.net development server and creates a single file:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c43ddc22\268ae91b\hash\hash.web
but when I start it from a stand alone project i get a whole slew of files in here:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\edad4eee\d198cf0e\App_Web_defaultwsdlhelpgenerator.aspx.cdcab7d2.vicgkf94.dll
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\edad4eee\d198cf0e\service1.asmx.cdcab7d2.compiled
etc etc
I am trying to debug this but not really getting anywhere. i have inspected the output from VS but the only option I get is for the build output, which is basic and doesn't really contain any information that is useful. I have tried running both versions with DebugView running but no output there either.
I would like to know if there are any log files I could look at, or if anyone has any suggestions on how I might be able to debug what is going wrong here?
For completeness the output I get when it doesn't work is:
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not create type 'WebService1.Service1'.
Source Error:
Line 1:
Source File: /Service1.asmx Line: 1
Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082
Ok, not sure that its perfect but I found a resolution to this issue. the problems seems to be that the development shell redirects the <OutputPath> of the projects visual studio is building, and this was causing problems as, although the dependencies of the web service project were being copied into the $(ProjectDir)Bin\ directory, the actual webservice dll itself was not. The solution (workaround?) seems to be to add this to the post build event command line:
xcopy /y "$(TargetPath)" "$(ProjectDir)Bin\"
Then i am able to right click on the .asmx file and select view in browser and everything works as expected.
Hope this might help someone else in the future. or maybe even me in another place and time.

Visual Studio thinks my controls are missing, but they're not. "The name xx does not exist in the current context"

When working with an ASP.NET application in Visual Studio 2008, my errors window often contains a list of errors such as;
The name 'txtUsername' does not exists in the current context.
When I double click on the error, it will go to the source, show the control underlined in red, then realise it's mistake and remove those errors. It's a real pain because if you have a genuine error, you have go and hunt for it.
Have you tried building the site?
Build -> Build Web Site

Resources