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.
Related
I am having a rough time figuring out how to setup cross-targeting inside a Visual Studio 2017 project and I have not been able to find any examples.
I started out with a .NET Standard 1.5 project and to keep it simple I am just trying to add .NET Standard 1.6. If I understand the documentation correctly, I should now be able to do all of this inside the csproj file without having to mess with a project.json or nuspec file.
I've tried all of these values but none seem to work:
<TargetFrameworks>netstandard15;netstandard16</TargetFrameworks>
<TargetFrameworks>netstandard1.5;netstandard1.6</TargetFrameworks>
<TargetFrameworks>.NETStandard,Version=v1.5;.NETStandard,Version=v1.6</TargetFrameworks>
This is the only source of documentation I can find on the feature and it doesn't contain a full example:
https://docs.nuget.org/ndocs/schema/msbuild-targets
https://docs.nuget.org/ndocs/create-packages/supporting-multiple-target-frameworks
I've gotten this to work on latest Visual Studio 2017. As described in this post https://blogs.msdn.microsoft.com/dotnet/2016/10/19/net-core-tooling-in-visual-studio-15/ it is the correct way to do it. My csproj file looks like this:
<PropertyGroup>
<TargetFrameworks>netstandard1.6;net452</TargetFrameworks>
</PropertyGroup>
Visual Studio 2017 RC release notes also has this listed as a feature (under .NET Core and Docker):
Cross-target multiple target frameworks in one project.
My mistake at the start was that when I first created the project the property was called TargetFramework, I tried to add multiple targets and VS did not like that at all. It just crashes then... So make sure to rename it to TargetFrameworks and it should work.
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.
Recently upgraded to VS 2010 from 2008, the previously built solutions are throwing the following error.
Error 14 Encountered multiple versions of the assembly with GUID 'a5851ea0-2f9a-40b2-a73a-cd7db32f09c5'. Try pre-importing one of these assemblies
I tried re-installing VS 2010 and it didnot help. Any ideas?
Is it the VS 2010 application itself crashing, or does it not like your solution? Can you open VS 2010 by itself? If so, it sounds like it doesn't like some of your references in one or more of your projects. Check the project references. If that doesn't work, start removing projects until you find the offending one.
This may happen, if you copy-paste-renamed a project file to re-use its settings but didn't changed the project GUID of it. Also could be a project migration error, anyway you will have to manually edit the project file and remove the duplicate references if the project fails to load because of the error.
I had the same issue when migrating 2008 -> 2013.
It was caused that we use same linked AssemblyInfo.cs for all projects in solution.
And only for the assembly that used some COM objects (MSMQ) it seems that it starts looking on referenced assemblies GUID and two of them from our solution...
So when I provide individual AssemblyInfo.cs for projects with unique GUIDs it start working.
Hope this info will helpful.
Try to remove the references to the debug folder.
In Visual Studio right click on Project
Select Properties
Select the references tab.
Check to see if any of the references are from the obj\Debug folder and remove them.
See similar question here.
I have a quick question....building a VS 2010 SharePoint project and I am referencing a custom assembly. I can reference this assembly in my code and it works fine to write code and all. When I deploy the project to SharePoint my Feature Activation code will not run because the custom assembly does not get deployed with the project.
I have set Copy Local to TRUE on the referenced assembly. Am I missing something?
Thanks
When you Create SharePoint Project in Visual Studio 2010, you will see a Item called Package in it.Click open it and bottom left corner click on Advanced, you will see an option to add additional assemblies , add as many you want > all assemblies you select here will get deployed as a Part of SHarePoint Package you create.
Not sure if this is what you're looking for, but you can use ilmerge.exe to bundle satellite managed assemblies into your executable, making it portable and more easily deployed. I use it all the time, it works great.
You can set up a build event in VS2010 to do this automatically whenever you build, too, though it can be a bit slow (I have it set as a Release-only build event for this reason).
I've been working with Visual Studio 2010 Beta-2 to get some advanced learning on WF4.
Everything was going fine until today, when I un-installed Visual Studio 2010 Beta-2, and installed the Visual Studio 2010 Release Candidate. My code is complaining that it can’t find the System.Runtime.Persistence namespace that I am using, and also, the InstanceStore, and InstanceView types contained in that namespace. Does anyone know if those types have been moved to a different namespace in the Release Candidate?
Isn't it in System.Runtime.DurableInstancing?
Protip: remove the reference to System.Runtime and then compile. The error message tells you what assembly to add.