MSBuild Errors while building VSTO Addin's - visual-studio-2013

I recently migrated my VSTO Add in projects from "VS2008 and office 2007" to "VS2013 and office 2013", Changes took place as below settings.
.Net Framework version from 3.5 to 4.5(While upgrading project).
I have added VSTO 2013 PIA assemblies to reference.
That's it, when i tried to compile i have faced below MSBuild errors.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(268,13): error MSB4064: The "TargetFrameworkVersion" parameter is not supported by the "SignFile" task. Verify the parameter exists on the task, and it is a settable public instance property.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(264,9): error MSB4063: The "SignFile" task could not be initialized with its input parameters.
and i have tried to find solutions over the internet but couldn't find much, Any Solutions for this problem will be helpful.

The problem was not the MSBuild, **
i have updated visual studio update 3 to update 4
and started working like charm.
I think Microsoft guys have moved something around from Update 3 to update 4 but this has been reported several times in many forums and i don't know why they have not mentioned it but this is one effective solution.

I ran into this issue. The problem is that Update 3 of Visual Studio 2013 moved some things around, so you need to use the MSBuild that is now installed with Visual Studio 2013 (or the standalone build tools for build servers). You need to make sure that you're using the correct MSBuild (currently at C:\Program Files (x86)\MSBuild\12.0\Bin), and it should work.
http://datatoknowledge.com/2015/01/30/vsto-and-visual-studio-2013-update-3/
Erick

This is still not working as of Visual Studio 2015 Update 3.
I had to actually modify the C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets file and remove the TargetFrameworkVersion attribute from the SignFile task.

Related

MSBuild throws error of DeploymentModel for SSIS project

I'm trying to build VS (version 2019) SSIS project with MSbuild in CMD, but gets error:
The element DeploymentModel beneath element Project is unrecognized.
It worked only after I used this WA from 2017:
https://github.com/dotnet/msbuild/issues/2064#issuecomment-315875143
I was wondering if there is already solution for it or this is just the way it works?
another answer which might be relevant:
https://stackoverflow.com/a/46275125/14976099
I'm asking again as when using devenv you need Visual Studio installed on your computer, and for MSBuild you only need to have the .NET framework installed (which is where I'm hoping to get)
Per my understating, the answer is here and was released few months ago:
https://developercommunity.visualstudio.com/t/support-ssis-ssrs-ssas-in-msbuild/523612#T-N1246482

Could not load UI satellite dll 'FileTracker32UI.dll'

I've run in to an issue where I can't build a freshly created C++/CLI Class Library project in Visual Studio:
Even though I haven't made any changes I get an error when I try to compile:
Severity Code Description Project File Line Suppression State
Error Could not load UI satellite dll 'FileTracker32UI.dll'. Make
sure it exists in an LCID subdirectory of 'C:\Program Files
(x86)\MSBuild\14.0\bin\'. TestProject c:\Users\abcde\documents\visual
studio 2015\Projects\TestProject\TestProject\FileTracker 1
I've created C++/CLI Class Library projects in the past on the same computer using Visual Studio 2015 without encountering this problem. Any idea what has gone wrong?
I ran into this strange issue today without making any code change. I suspect it appeared due to overnight windows update.
In my case , I copied the two files FileTracker32UI.dll and FileTracker64UI.dll
From
C:\Program Files (x86)\MSBuild\15.0\FileTracker\3082\
To
C:\Program Files (x86)\MSBuild\14.0\Bin\3082\
and it worked. My visual studio version is
Microsoft Visual Studio Community 2015
Version 14.0.25123.00 Update 2
I am hoping the info helps someone.
I had the exactly same problem, after some windows update by my IT.
According to the information (https://forum.dlang.org/post/ezuohezwuzyitjdzpfdw#forum.dlang.org), I renamed the file "FileTrackerUI.dll" to "FileTracker32UI.dll" in the latest LCID folder (latest numbered folder in same location)
Then, it worked at my PC.
Good luck
In my case it was a path issue. Using another directory (shorter path without special characters) solved the problem

Tools Version Using Visual Studio 2017 with TFS Build 2015

I'm getting ready to start building our new release with Visual Studio 2017. I have not moved to vNext, still XAML, but plan to move forward soon when the dust settles.
At one time I thought I would be using VS 2015 and 2017 on the same machine so I had asked a question on how to differentiate or tell TFS Build which VS version to use. I was told to add these MSBuild params to the Build Definition...
/tv:15.0 /p:VisualStudioVersion=15.0
It turns out the machine will be solely using VS 2017, but I left those parameters in the Build Definition.
When I ran the build, I received this error...
MSBUILD : error MSB1040: ToolsVersion is not valid. The tools version
"15.0" is unrecognized. Available tools versions are "4.0". Switch:
15.0
So, I removed the /tv parameter and the error went away. So, my question is, without the parameter, what tools are being used? Is the toolset TFS or Visual Studio related? Is the v15.0 toolset, if it even exists, a separate installation?
Here is the link to my original discussion on this, but I haven't been able to put it into practice until now...
TFS 2015 XAML Builds with Visual Studio
Any information, help is appreciated!! I just want to better understand what is going on for future server builds.
So, after the first response, here is additional information. From the failed build's diagnostic log, I see this...
MSBuild auto-detection: using msbuild version '15.7.179.6572' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\bin'.
You can able to download the MSBuild 15.0 package alone here
This error will occur in 2 scenarios
MSBUILD : error MSB1040: ToolsVersion is not valid. The tools version
"15.0" is unrecognized. Available tools versions are "4.0". Switch:
15.0
When you don't have installed msbuild 15.0 in your TFS Server
Your TFS Agent pointing wrong MSBuild Version ( see below image pointing towards msbuild version 15.0 )
Solution
For the 1st case, you can download the msbuild package
For the 2nd one, you can define your own Environment Variable to point towards the msbuild 15.0 version.
There is a similar question on MSDN see the solution, though might help.

Convert SharePoint 2010 Solution to 2013 and Visual Studio 2012

I am trying to convert a SharePoint 2010 solution (custom web parts, content types, lists, event receivers, etc.) developed in Visual Studio 2010 to SharePoint 2013 and Visual Studio 2012. When I open the project in VS 2012, it converts a couple of the project files but won't compile because of reference issues.
I copied the DLLs (mostly Microsoft.SharePoint..., although I needed to copy the Microsoft.Office.SecureStoreService.dll too) that were causing issues from my 2010 server to the 2013 server and fixed the references. However, the Microsoft.Office.SecureStoreService.dll still gives me compiler errors claiming "Error 203 The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)" when visual studio has no problem with the namespace and finds the SecureStoreProvider class inside it just fine.
I've also tried to change the target framework from 3.5 to 4 and only see "Install other frameworks..." in the target framework dropdown.
I'm sure that others have dealt with this, but have been unsuccessful in framing the right google search query. I'm relatively new to SharePoint in general and any help would be appreciated.
thanks,
Mike
I was able to get my solution upgraded from a 2010 project to 2013 using the following. Note that this will update your solution to use the new 2013 API. It is possible to update just the project file but still run in 2010 mode.
First edit your .csproj file (for c#).
Modify the target framework to this:
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
Add this a node for the office version, I put mine directly below the TargetFrameworkVersion tag
<TargetOfficeVersion>15.0</TargetOfficeVersion>
Update references
Reload the project and update your referenced assemblies. If you haven't specified a specific version they should already be referencing the v15 (SharePoint 2013) assemblies.
Do a find replace for 14.0.0.0 to 15.0.0.0. This updates any references on your pages, layouts, and master pages to the v15 assemblies.
Change calls
Change any calls to SPUtility.GetGenericSetupPath() to SPUtility.GetVersionedGenericSetupPath()
Check each file to do a check for any hive references. You'll need to add a /15/ to these. EG: _layouts/ to _layouts/15/
Open the package "folder" in visual studio then update the properties for that package to use version 15.
Clean up
Finally do a compile clean up any missed items. Deploy your solution and make sure to test thoroughly.

"Exception has been thrown by the target of an invocation." when building a Visual Studio 2010 VSPackage

I recently create a couple of VSPackages for some Visual Studio extensions (menu bar/command). I compiled them correctly yesterday, checked into TFS (i'm the only one touching this project, FYI). I had already installed these extensions and were working fine. Today it doesn't compile! I get the following error:
Exception has been thrown by the target of an invocation.
This doesn't tell me anything, so i fired up Visual Studio with the following command:
devenv.exe /Rebuild > out.log
In my out.log, I see the following:
C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\VSSDK\Microsoft.VsSDK.targets(420,5): error : Exception has been thrown by the target of an invocation.
I have been stuck on this for hours and can no longer build these VSPackages. Anyone? This is really frustrating. I have already tried cleaning project/rebuilding/build using Visual Studio itself (not command line)
I've experienced this issue several times in both vs2010 and vs2012, and manually deleting the "bin" and "obj" folders from the project then doing a "rebuild" normally does the trick.
Further to the answer provided by the OP, I will provide it here for completeness instead of relying on the external link remaining live:
Quoted directly from the MSDN forum answer:
Do you happen to have these extensions installed to the AllUsers
location (i.e. %VSInstallDir%\Common7\IDE\Extensions)?
You mentioned in your initial post that "I had already installed these
extensions and were working fine."
The task that's failing (based on the line number in the targets file)
is the UninstallExtension task. The only reason I'm thinking this task
would execute and fail in your situation is if you're building an
extension that's already installed to the Common7\IDE\Extensions
directory.
Regards, Aaron
I find myself on this question because of exactly the same build issue of a VSIX Installer Project for our project templates. This solved my issue.
Indeed, I uninstalled the prior version of our templates and the build occurs without issue.
Have you double checked that all of your projects are using compatible framework versions?
As in you can't use a .Net 4.0 assembly in a .Net 3.5 project.
Is the project linked with source control like TFS? If so then take latest from TFS and try again.
Are you running Visual Studio as Administrator?
Maybe you have insufficient rights for some file (copy/move/delete) especially in bin or obj folders.

Resources