Sharepoint WebPart, include additional assembly in wsp package - sharepoint

I created a utility library for my Sharepoint WebParts. Now when I reference this library from my WebPart project, it compiles fine, but the library is not included in the .wsp package. This means the library assembly is not deployed to the target system, causign the WebPart to fail.
Is there any way to fix this? I am using Visual Studio 08 & VseWSS 1.2.

Brij's answer is partially correct, your VSeWSS version is the problem. This feature only came in version 1.3 (I recommend the March CTP) to have the CopyToLocal=true automatically add the assemblies to the GAC for you.

Right click of Assembly > Properties
Set “Copy Local” property = true
Build project.
See following for more details:
http://urenjoy.blogspot.com/2009/08/add-assembly-wsp-vsewss.html

Related

References and .dll missing from TFS get latest

I'm having an issue related to team foundation server with Visual Studio 2012.
I've checked in a new solution to the server, however when i get latest version for other machines, most of the references are missing and the .dll files in the bin cannot be located.
Is this because the files are not being pushed when i check in.
Any help is appreciated thanks
In Solution Explorer, right click the DLLs that aren't being included, go to Properties, and be sure that the Build Action is set to "Content".
Check whether you are using MSBuild-Integrated solutions or using Automatic Package Restore. If you use MSBuild-Integrated solutions, migrating MSBuild-Integrated solutions to use Automatic Package Restore.
If you haven't used Nuget to restore package. Check: https://docs.nuget.org/consume/package-restore
Check whether your project link to other projects. Don't reference output assemblies. Make a project reference or create a NuGet package.

InstallShield Extension Condition DLL in .NET

I'm writing a Suite Installer in InstallShield 2012 Spring Premiere and am including an Extension Condition DLL in the project. I have a .NET version of the library that is included with my application and I'd like to add on the Extension Condition APIs to it so that I don't have to write a C++ version of the exact same code.
Has anyone done this before? Is there a sample project I can look at? KB Article reference?
Many thanks!
may be you can make your .Net Dll COM Visible. Look at this article.
http://jumbloid.blogspot.ca/2009/12/making-net-dll-com-visible.html

Cannot load library into assembly (GAC)

I am using visual studio 2010 on windows server 2010 with Sharepoint 2010 server. I am deploying webparts to a Sharepoint instance running on the same server.
My new webpart makes use of a custom library, AE.Net.Mail. When I deploy this webpart, I get the Could not load file or assembly... error for AE.Net.Mail. I have run gacutil but I do not see the assembly in C:\Windows\assembly. I do see it in a subdirectory of C:\Windows\Microsoft.NET\assembly.
Now I am not sure about this but I think when my Sharepoint instance runs, it only looks at C:\Windows\assembly. And that is why it is not able to find the library. The reason I believe this is that the name of my webpart is present in C:\Windows\assembly. It's being cached there and not in a subdirectory of C:\Windows\Microsoft.NET\assembly.
I am using version AE.Net.Mail Version 1.6.0.0 which is compatible with .NET 3.5. I think my Sharepoint server is using 3.5 although 4.0 is present on the machine. I think so because when I tried to install the the library using nuget, I couldn't install the latest version that requires .NET 4.0. The error said that my project is using 3.5. Version 1.6.0.0 is compatible with 3.5
So, what do you guys think is going on and how do you think I can get AE.Net.Mail into C:\Windows\assembly? Been at this for hours now and I can't figure it out (Dragging and dropping doesn't work)
Thanks guys. :)
Judging from the sources AE.Net.Mail isn't strongly typed which is something GAC-deployment (and SharePoint) require.
To add the binary to the GAC you must download the binaries of AE.Net.Mail from Github, sign the assembly and compile it yourself. This is easy, simply follow this guide http://msdn.microsoft.com/en-us/library/ms247123(v=vs.100).aspx
Remember to compile for .net 3.5 since that's what SP2010 supports, it wont recognize net4 assemblies

Missing assembly in Visual Studio 2012 ( but it is there! Honest! )

I have a project using Reactive Extensions and ReactiveUI. I upgraded to the pre release version and I have the following line of code
OAPHCreationHelperMixin.ObservableToProperty(observable,
Function(x) x.Value
Visual studio tells me there is an error here on the method ObservableToPropertyin that the following assembly is missing
Error 9
C:\Users\phelan\workspace\WeinMeasEval\WeinMeasEval\Global\ObservableBinding.vb
Reference required to assembly
'System.Reactive.Interfaces,
Version=2.0.20823.0,
Culture=neutral,
PublicKeyToken=31bf3856ad364e35'
containing the type 'System.Reactive.Concurrency.IScheduler'. Add one to your project.
Now I click the link which suggests it will add the reference and then nothing
happens. If I look in my project references I see that the assembly is indeed
in the assembly list and it is the correct version 2.0.20823.0 and if I look on
the path the DLL is indeed there.
Any ideas?
This is now fixed, check out ReactiveUI 4.0 Preview 5
It turns out that at this date reactive UI is not built yet for .NET 4.5 as the developer is having some build issues.
As a work around I build it myself by pulling the repository from Git and referring to the core library directly from within my .NET 4.5 project.
This seems to work at the moment. YMMV
Do you have Target Framework set to full .net or to Client Profile (in project settings)?

Version SharePoint WSP

Has any one tried to version WSP in SharePoint 2010?
Thanks,
It would help to be a bit more specific that ".wsp" in your question.
As Flo mentioned - if you keep the assembly version the same but change the AssemblyFileVersion then you can upgrade the assemblies in your WSP solution using
STSADM -o upgradesolution ...
See my answer on SO - How can I use wildcard assembly versioning?
This will suffice for webparts but if you've got other artifacts and are using things like Feature things like event receivers then you may have to retract and re-deploy.
Thanks all for your replies. I have two concerns:
a. Assume my wsp is deploying a webpart with assembly version as 1.0.0.0 and assembly file version is also 1.0.0.0. Now after few days i need to deploy a recent version of webpart. The assembly version now will be 2.0.0.0 and assembly file version will also be 2.0.0.0. I have noticed that even if i retract and redeploy the wsp, the .webpart files that sits in the web part gallery always shows assembly version as 1.0.0.0. I guess this is because wsp retraction will not delete the .webpart file and neither feature deactivation. So the only option that remains is to write feature deactivation code to delete the .webpart file from webpart gallery. This will be largely in efficient as i will need to iterate through all the site collections of deployed webapplication to determine from the code ( a windows form as installer) the site collection where feature is activated and deactivate the same.
b. I need to query the webpart dll version for some operation. I was thinking it will be good if we can version wsp and keep the wsp version same as the web part dll. This will help me to remain in the SharePoint context to determine the web part dll version ( rather than querying the dll to find the version).
Thanks
WSP don't really version.
You can however version components into it:
Feature or WebParts via different names (FeatureV1, FeatureV2...)
Assembly using standard assembly versioning (WebpartV1 use assembly 1.0.0, WebPartV2 use 1.1.0 and so on)
...

Resources