WSPBuilder cannot find my assembly - sharepoint-2007

I am using WSPBuilder on Visual Studio 2010 to create a feature with a feature receiver assembly for SharePoint 2010. When I try to build the WSP using WSP Builder I get this message in the output window:
The assembly MyAssembly.dll is unmanaged. The assembly will be excluded from the WSP package!
The defined Project Assembly seems not to be a valid assembly!
Solution compatibility: SharePoint 2010
The resulting WSP that gets built does not contain my DLL.
My DLL is strongly named, and I cant think of any other obvious reasons why this is happening.
Any idea why WSPBuilder is not able to package my assembly in the WSP?

Ahh... Found the answer. My code was getting compiled against .Net Framework 4.0. Changed it to .Net Framework 3.5 and Voila! WSP gets built without any problems...

Related

Can't find VS2015 TeamFoundationServerExt on nuget

I've referenced the latest Microsoft Team Foundation nuget packages found at https://www.visualstudio.com/integrate/get-started/client-libraries/dotnet but I cannot find a reference anywhere for TeamFoundationServerExt. Does anybody know if these have been moved to a nuget package too? If not where can I reference from (I was hoping not to use direct paths to Visual Studio 2015)?
You're looking for:
https://www.nuget.org/packages/Microsoft.TeamFoundationServer.ExtendedClient/
PM> Install-Package Microsoft.TeamFoundationServer.ExtendedClient
I'm not sure which Assembly you're looking for, Microsoft has never shipped a TeamFoundationServerExt assembly, all the functionality you need is broken into one of the at least 20 assemblies added to your project when referencing this package.
There is a class TeamfoundationServerExt, which is part of the assembly Microsoft.VisualStudio.TeamFoundation, that one is part of the Visual Studio SDK and/or full Visual Studio installation and is not available as a redistributable Nuget package as far as I am aware of.
I am using the nuget package Microsoft.TeamFoundation.ObjectModel I does have the down side of only being for .net 4.5

Creating a F# PCL for Universal apps (a.k.a. Store Apps or Windows apps or WinRT apps)

Since Visual Studio 2013 Update 2, it is possible to create Portable Class Libraries (PCLs) that can reference Windows Runtime types (which was not possible before) as long as they only target Windows 8.1 and Windows Phone 8.1 and no other targets.
I tried this in C# by adding a C# Class Library (Portable for Universal Apps) and it works, which means that you can consume and produce Windows Runtime types as if the project was a Windows App or Windows Runtime Component.
Since F# also supports PCLs and Windows 8.1 and Windows Phone 8.1 are supported targets, I would like to achieve the same with F# PCLs (if possible). While Visual Studio 2013 Update 4 does not offer creating F# PCLs that only target Windows 8.1 and Windows Phone 8.1, it is possible to modify the .fsproj file of an F# PCL to match the .csproj file of a C# PCL with those targets that was created with Visual Studio. This requires changing the XML elements to the following:
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile32</TargetFrameworkProfile>
and adding the following to an <ItemGroup>
<TargetPlatform Include="WindowsPhoneApp, Version=8.1" />
<TargetPlatform Include="Windows, Version=8.1" />
After these changes, I was able to consume and produce Windows Runtime types in the F# PCL as in the C# PCL (without complaints from Visual Studio in the F# PCL or C# (Universal) Windows App), but when I actually run the (Universal) Windows App I get the following exception when a function that uses Windows Runtime types is called in the F# PCL from the C# (Universal) Windows App:
An exception of type 'System.IO.FileNotFoundException' occurred in
[application name].exe but was not handled in user code
Additional information: Could not load file or assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null' or one
of its dependencies. The system cannot find the file specified.
When I check the references in the Solution Explorer of Visual Studio, the C# PCL shows a reference named Windows, which is missing from the F# PCL. The Reference Properties of that reference look like this:
I tried adding this reference manually to the .fsproj file of the F# PCL by adding
<Reference Include="C:\Program Files (x86)\Microsoft SDKs\Portable\v12.0\110C4FEFF2BA61C0746933A9ED6E248D\Windows.winmd" />
to an <ItemGroup>. After this, the reference does show up in the F# PCL in the Solution Explorer with the following Reference Properties:
but does not fix the problem. That is, I still get the same exception as before.
I also tried copying and pasting the Windows reference via the context menu of the Solution Explorer of Visual Studio, but it complains with an error message.
Do you know how to properly add the Windows reference to a F# PCL? This would be really awesome, because that would make it possible to write (Universal) Windows Apps almost entirely in F#! If you know for a fact that this is not possible, then could you please explain what is preventing this from being possible?
EDIT: improved formatting of exception message
You're making a portable class library. F# does not support windows store apps, so the only way you can use F# in such a situation is to call it from C#. If you manage to succeed, you'll be the first of anyone.

Visual Studio 2012 can't resolve namespace even though DLL reference seems fine

I have attempted to create an MVC 5 project by creating an MVC 4 project in Visual Studio 2012 and installing MVC 5 through Nuget.
I can build this fine.
I attempt to add a reference to another DLL, Sitecore.Mvc.DLL, which I can see was built against MVC 5.1.0. The DLL reference is added fine, and there seems to be no .NET framework conflict (which is where I've seen this issue in the past).
I'm trying to add a using statement to my code:-
using Sitecore.Mvc.Presentation;
IntelliSense picks this up fine....even allowing me to auto-complete 'Presentation'.
However when I build I get the following error:-
The type or namespace name 'Sitecore' could not be found (are you missing a using directive or an assembly reference?)
What could be the issue here?
I'm using:-
Visual Studio 2012 - Update 4
MVC 4 Web Application (initially)
MVC 5.1.0 Nuget Package
Sitecore 7.2 - Update 2 (where Sitecore.Mvc.DLL comes from)
.NET 4.5.2 installed on my machine.
Turns out I'm using a different version of Sitecore.Mvc.DLL, which IS targeted to .NET 4.5.1. Seems like the mscorelib reference in Reflector doesn't quite tell all the details.
Now I need to target my Web App to .NET 4.5.1, which means I need to follow the steps here to be able to select it.
http://blogs.msdn.com/b/dotnet/archive/2013/08/08/building-apps-with-the-net-framework-4-5-1-preview-in-visual-studio-2012.aspx
Thanks, and sorry to #Khanh TO, and everyone else for helping out.

Missing reference to System.Web.Mvc in Asp.net Unit Test?

I recently made some unit tests for my Asp.NET MVC application, or I tried to, it keep telling me "The type 'System.Web.Mvc.Controller' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Mvc, Version=5.1.0.0, Culture=neutral.' Then I tried to add a reference to the above mentioned, but was only able to choose version 4.0.0.0 and now it tells me that my project already uses version 5.1.0.0, which is a higher version. What to do?
Thanks a bunch!
MVC 5 comes in from a NuGet package. Just as it did with the main MVC web project in your solution. Install MVC via NuGet into your Test project, and you should be good to go.
An educated guess, but you might have obtained the newer version via a nuget package(some of the newer MVC project templates do this), and thus it is not installed in GAC. Use the nuget package manager for the MVC project to determine if this is the case, and if so then mystery solved.
In the test project you can add the same package, or use the addreference->Browse to browse into the nuget dependencies and poke around under the MVC project till you find the DLL(it will be in the file system somewhere under SolutionName/MvcProjectName/packages).

Where can I get the F# Compiler and FSI v4.0?

I know I can download the "April CTP" to get F# 2.0 for .NET 2.0. But I need FSC and F# Interactive for .NET 4.0. On a machine with VS 2010 installed, it ends up in C:\Program Files (x86)\Microsoft F#\v4.0. Is there a redistributable for this?
If you installed Visual Studio 11 Beta or Visual Studio 2012, I recommend you check the following path, where you will find Fsi.exe and Fsc.exe.
C:\Program Files (x86)\Microsoft SDKs\F#\3.0\Framework\v4.0
Others have provided good answers; I'll summarize and add one more bit (2nd bullet):
We don't have any polished story here yet. We're working on one.
In the case of the compiler, you may be able to get by with the fsc.exe in the April CTP (it is capable of referencing .NET 4.0 assemblies and building .NET 4.0 assemblies, even though the compiler itself runs on 2.0). (Note that for building project files, you might also need the right Microsoft.FSharp.targets imported; I haven't worked all that through...)
If you were to copy the right assemblies and targets files from a VS2010 install to another machine, that would work, but offhand I don't know if that violates the VS license.
The existing downloadable "redist" does only contain FSharp.Core.dll.
(possibly see also this for a similar discussion but no extra info, as well as this Connect request)
The redistributable, for the F# runtime, is available at the following link, but unfortunately doesn't include the compiler or F# interactive:
http://www.microsoft.com/downloads/details.aspx?FamilyID=5f0a79f8-925f-4297-9ae2-86e2fdcff33c&displaylang=en
If you already have VS2010 installed on the machine there shouldn't be no need to install it, as the compiler, fsi, and F# runtime will be installed with VS. It should be just a matter of adding the directory containing the compiler to the path, so the shell can find it (if you want to use the compiler/fsc from the command-line).
This is an old question, but I came across it and thought that I'd add an update for people who find it through Google:
The current version of the F# CTP (April 2011) includes both .NET 2.0 and .NET 4.0 binaries, including FSI.exe. On my install...
.NET 2 = C:\Program Files (x86)\FSharp-2.0.0.0\bin\
.NET 4 = C:\Program Files (x86)\FSharp-2.0.0.0\v4.0\bin\
I think that there is no standalone installation of F# for .NET 4.0 (similar to the standalone installation for .NET 2.0). The reason probably is that F# for .NET 4.0 is simply meant to be distributed only as part of Visual Studio 2010 and not separately (just like other core Visual Studio languages).
If you need to use fsi.exe and fsc.exe for .NET 4.0 on a machine that doesn't have Visual Studio installed, you'll probably need to copy them together with the referenced libraries. This shouldn't be that difficult - you only need assemblies from "C:\Program Files (x86)\Microsoft F#\v4.0" together with FSharp.Core.dll (which should be added to the GAC) and (I think) also ISymWrapper.dll (but I'm not quite sure where this is located).

Resources