I am on a SharePoint project that has a dozen or so Provider Hosted Applications.
For those not familiar, PHA's are basically fancy MVC web apps but they have a secondary "special" project that gets added to the solution that contains an app manifest used by SharePoint (sort of reminiscent of old VDPROJ project types). This special project type is only used when packaging the application for consumption by SharePoint, it serves no other purpose and therefore has no need for generating output such as DLL's or EXE's (except for when creating a deployment package, but that is irrelevant to this conversation).
The problem I am having is Visual Studio fails when running Code Analysis on all the PHA's because the PHA's app project does not generate a DLL. The analysis isn't running and reporting errors, it has a hard failure because it is expecting the special app project to generate a DLL and that DLL is physically not found. This prevents Code Analysis from even getting to the point of checking if the checkbox for "Enable Code Analysis on Build" is checked or not (which it isn't in case you're wondering). The only thing I get is two error messages like this person on CodePlex was having:
CA0052 Error Running Code Analysis CA0052: No targets were selected. [Errors and Warnings] (Global)
CA0055 Error Running Code Analysis CA0055 : * Could not load file: 'bin\Debug\xxxxx.dll'. [Errors and Warnings] (Global)
I have even gone to the point of creating a brand new PHA project from scratch using the Visual Studio 2013 wizard leaving everything as default which should eliminate any potential for hard external references the existing projects might have. Even then I still run into the same problem. Every time Code Analysis is run Studio tries to test that special project and throws the hard failure.
The weird thing is Code Analysis is running on the TFS build agent without incident. This leads me to think that the issue is Studio related and specific to the version installed locally. However, I have tried this with VS2013 RTM, 2013 Update 5, and VS2015 Update 3 and they ALL behave the same. Create a new PHA, follow the prompts for local development using MVC, and then run Alt-F11 and the issue reproduces.
Can anyone get Code Analysis to work on a SharePoint PHA?
Related
I can build and debug my project (Web Forms App / VS 2015) but when I attempt to publish I don't get any errors (in the standard errors panel) but in the output window I see I do and the publish fails, but the build runs !?!?!?!?
Each of the types do exist and the namespacing is correct, I have no idea why these issues are stopping me from publishing ?!?!?!?!
The issue fixed itself, I didn't do anything or make any significant changes.
I have been sent a working project from a coworker to start learning Visual Studio. The project is under version control, however I don't want to have access to final customer product. So when I try to open the solution file I first get a message that the project is under source control:
"Team Foundation Server Version Control
The solution you are opening is bound to source control on the following Team foundation Serer:
http:// . Would you like to contact this server to try to enable source control integration?"
[yes] [no] [help]
I press no, then I get an error:
"The solution appears to be under source control, but its binding information cannot be found. Because it is not possible to recover the missing information automatically, the projects whose bindings are missing will be treated as not under source control."
[ok] [help]
I proceed and press ok, and another message pops up:
"projectname\projectname.tsproj: The application which this project type is based on was not found. Please try this link for further information: http://go.microsoft.com/fwlink/?prd=12395&pver=11&sbp=ProjectTypeDeprecated&plcid=0x409&clcid=0x409&ar=MSDN&sar=ProjectCompatibility&o1=B1E792BE-AA5F-4E3C-8C82-674BF9C0715B"
My coworker tells me he sent the whole project, so I can't figure out why I cant get visual studio to open it. I am new to visual studio, but I have some programming experience.
Any help is much appreciated.
Thank you
It is doubtful that version control has something to do with your problem. There are two possibilities I could think of:
Your coworker uses full version of VS2012 and you are now having problems due to the fact that Visual Studio Express comes in two main flavours - Web and Desktop. It is unable to load Web(or Desktop) project because it just does not have any tools to work with it. Ask your coworker whether they mix web and desktop in their solutions. If it is so you should either use full VS or be given a reduced set of projects.
Nearly the same - your coworker uses some very old or very new version of particular project type (something like ASP.NET MVC that(as I remember) has different project type for each version). Again ask your coworker if it is so. In this case you will just have to install the needed templates and SDKs.
P.S. I was unable to open your link - it opens microsoft.com/default(maybe due to some regional problems). Search by key words brought to me similar problem for VS2010 http://connect.microsoft.com/VisualStudio/feedback/details/728847/could-not-open-vs2010-solution-with-mvc-project - may be it could help you more specifically.
We are creating a Windows 8 Store app using Visual Studio 2012 which uses an online Azure database. In uni we work off Windows 8 machines and at home we work off Windows 8.1 machines with Resharper. Everyone on my team has begun receiving these errors recently, seemingly out of the blue:
Processing Resources with error: Unspecified error - File: MakePri
(Pri not PRI)
Multiple entries of
'Microsoft.Data.OData/DuplicatePropertyNamesChecker_MultipleLinksForSingleton'
found. - File: MakePRI (PRI not Pri)
And in our unit test project:
Processing Resources with error: Unspecified error - File: MakePri
(Pri not PRI)
C:\temp\resources.pri not found. (our build output is C:\temp for our main project and C:\temp\test for our unit tests as we work off networked drives in uni - if we have them building to the same folder we get another error about the appmanifest!)
Our references in our main project (includes Microsoft.Data.OData):
Our references in our unit test project (does not include Microsoft.Data.OData):
It seems to happen to each of us at different times and we can't seem to pinpoint any cause at all. Sometimes it will simply disappear, other times it will not. The only recent changes I can think of is that we recently added Callisto, but I can't see why that would cause such a strange problem.
The only results I have found when googling MakePri appear to be from developers having the same issue but because they are using different locales other than English ones - but we are not working on machines with any language other than English and are not using any languages other than English within our project.
EDIT: Removing and readding the reference has worked temporarily, although I have a feeling this error may crop up again.
We are having compilations problems in a TFS server and it's because the server lacks several libraries built in the default VS2012 Premium installation (Microsoft Fakes in this case).
I'm unsure of going ahead installing a full instance of VS, but first I want to know what is the best practice in this regard?
What is recommended?
Since we are talking a sandbox, do whatever and don't worry about it. If we are talking best practices, it's not a good idea to put your build tier on the app tier / data tier. Any developer could check in code that gets run on the server during the compile and trash your entire environment.
Have you looked at Visual Studio Online? It's a hosted TFS service and you can use their hosted build controller or configure your own. That makes for a very good sandbox IMO.
I don't see any issue installing VS on the TFS server(I assume you run your builds on that server too and that's when you are seeing the problem. Ideally tfs server and build box should be separate but some people use the same box.)
I have used Visual Studio on the build box several times to debug issues with builds. You just need to make sure you close the VS instance (if it has a solution open) once you are done with debugging otherwise your builds can fail when they try to clean up the project directory at the start of the build.
We run a single server TFS instance which has everything - sql, SharePoint and tfs - running on it. It is also a build server so it has to have VS 2010 and 2012 installed. We've done this with all versions since 2005 and have had no issues with it at all.
It has been a while since I've published my app to Azure. During that time frame, I've upgraded my system from 32-bit to 64-bit meaning a fresh install of Windows and Visual Studio. And Visual Studio Update 3 came out and was applied. When I went to publish an update today, I received the following:
The following exception was thrown trying to publish: Root element is missing.
My web.config file looks fine so I don't think it's this issue.
The app works fine in debug mode so I don't think it's any of the .lsml files as is mentioned here.
And I tried this procedure to hand edit the .ls3proj file but it didn't seem to help.
I previously had an issue trying to publish when I upgraded from the standalone LightSwitch 2011 to Visual Studio 2012. I was able to overcome that issue using the method described in this thread.
Attempting to use this same method resulted in my new project has a full screen error saying "There are critical errors in the application definition metadata..." and 210 individual errors (max errors reached).
The first error, "Cannot create unknown type '{http://schemas.microsoft.com/LightSwitch/2010/xaml/model}GlobalAttributeGroup'." Doesn't make sense because that line in the .lsml is identical from the old project to the new project.
The second error, "Could not find any application definition in the project." Which I do not understand at all.
I am able to publish a simple "Hello, world" style app to my Azure account.
What could be causing this? How can I get more information about exactly which element is causing the issue? The log produced by running devenv /log was not helpful.
Matt Thalman was able to solve my problem over in the Microsoft Forums. The ServiceConfiguration.cscfg and ServiceDefinition.csdef were missing from the project when checked out of version control. Copying those over from a new project restored my ability to publish.