Error running sample Microsoft UCMA 4.0 sample in Visual Studio 2013 - visual-studio

I just want to test prebuilt Microsoft UCMA 4.0 Quickstart sample Application from Visual Studio 2013.
If i press Start, I get the warning:
Warning 1 The primary reference "Microsoft.Rtc.Collaboration, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the assembly "System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" which was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0". RecorderSample
and a bunch of errors, for example:
Error 3 The type or namespace name 'AudioVideo' does not exist in the namespace 'Microsoft.Rtc.Collaboration' (are you missing an assembly reference?) C:\Program Files\Microsoft UCMA 4.0\SDK\Core\Sample Applications\QuickStarts\AudioVideoCall\Recorder\RecorderSample.cs 10 35 RecorderSample
I have .net framework 4.5.1 on my pc

I resolved by going to project, project properties, application, target framework and changing to 4.5.1

Related

What do I need to install on a build server for MVC 3 & 4

I'm building a build slave for Jenkins with Ant and Ivy to build our Windows application. Parts of the application use MVC3 and MVC4. The same solution builds fine on my development PC. I cannot change the build, sln or csproj files to make this work.
I don't want to install Visual Studio at all.
What should I install to get this working?
Here's what I have already installed which does not work:
Microsoft ASP.NET MVC 2 - VWD Express 2010 Tools
Microsoft ASP.NET MVC 2
Microsoft ASP.NET MVC 3
Microsoft ASP.NET MVC 4 Runtime
Microsoft ASP.NET MVC 4
Microsoft Build Tools 2013
Microsoft ASP.NET and Web Tools 2013.4 - Visual Studio Express 2013 for Web
Microsoft ASP.NET and Web Tools 2013.1 - Visual Studio Express 2012 for Web
Here are the errors I'm seeing from the MSBuild steps:
[exec] Controllers\Controller1.cs(547,10): error CS0246: The type or namespace name 'HttpPost' could not be found (are you missing a using directive or an assembly reference?) [xxx.csproj]
[exec] Controllers\Controller1.cs(547,10): error CS0246: The type or namespace name 'HttpPostAttribute' could not be found (are you missing a using directive or an assembly reference?) [xxx.csproj]
[exec] Controllers\Controller2.cs(21,10): error CS0246: The type or namespace name 'HttpPost' could not be found (are you missing a using directive or an assembly reference?) [xxx.csproj]
[exec] Controllers\Controller2.cs(21,10): error CS0246: The type or namespace name 'HttpPostAttribute' could not be found (are you missing a using directive or an assembly reference?) [xxx.csproj]
Sorry for the wasted question. Had I looked earlier in the log, I would have seen that.
It turns out this is the known issue of the MVC 3.0.0.0 versus 3.0.0.1 reference caused by a Microsoft security patch.
"C:\scm\opt\hg\main\core\F4I\Reporting\Foundation\Poiesis.Foundation.sln" (default target) (1) ->
"C:\scm\opt\hg\main\core\F4I\Reporting\Foundation\Security\SSO\Poiesis.ClinicalModel.Security.Web.SSO.csproj" (default target) (16) ->
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\scm\opt\hg\main\core\F4I\Reporting\Foundation\Security\SSO\Poiesis.ClinicalModel.Security.Web.SSO.csproj]
Windows update caused MVC3 and MVC4 stop working

Project using PCL 'TPL Dataflow' won't compile when targetting .NET 4.5.2

I'm using Windows 7 Pro x64 SP1 and Visual Studio 2012 Update 4. I can't get my VB.NET WPF project to compile when using the TPL Dataflow package and .NET 4.5.2. I've created a base project with nothing except this code and compile only for x64:
Imports System.Threading.Tasks.Dataflow
Class MainWindow
Dim test As New System.Threading.Tasks.Dataflow.BufferBlock(Of String)
End Class
I've tried adding the facade reference to System.Runtime.dll and System.Diagnostics.Tracing.dll with no effect. It compiles fine if I change to .NET 4.5. I must have a reference to 4.5.2 because of other features that will be in the project that require it.
Specific errors:
Warning 1 The primary reference "System.Threading.Tasks.Dataflow, Version=4.5.23.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "System.Runtime, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.5.2". To resolve this problem, either remove the reference "System.Threading.Tasks.Dataflow, Version=4.5.23.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" or retarget your application to a framework version which contains "System.Runtime, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". TPLDataflow4.5.2Demo
Warning 2 The primary reference "System.Threading.Tasks.Dataflow, Version=4.5.23.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "System.Diagnostics.Tracing, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.5.2". To resolve this problem, either remove the reference "System.Threading.Tasks.Dataflow, Version=4.5.23.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" or retarget your application to a framework version which contains "System.Diagnostics.Tracing, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". TPLDataflow4.5.2Demo
Warning 3 Namespace or type specified in the Imports 'System.Threading.Tasks.Dataflow' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases. F:\Projects\TPLDataflow4.5.2Demo\TPLDataflow4.5.2Demo\MainWindow.xaml.vb 1 9 TPLDataflow4.5.2Demo
Error 4 Type 'System.Threading.Tasks.Dataflow.BufferBlock' is not defined. F:\Projects\TPLDataflow4.5.2Demo\TPLDataflow4.5.2Demo\MainWindow.xaml.vb 4 21 TPLDataflow4.5.2Demo
Solution:
It turns out the Microsoft .NET Framework 4.5.2 Developer Pack I was using had a bug that wouldn't let PCLs compile correctly.
I downloaded and installed the updated version of the Microsoft .NET Framework 4.5.2 Developer Pack from http://support.microsoft.com/kb/2901951 and my application was able to compile without errors.
There is a ticket on connect specifying the use of .NET 4.5.2 with PCL libraries causing builds to fail.
This was fixed in the Microsoft .NET Framework 4.5.2 Developer Pack
When you recompile a Microsoft .NET Framework 4.5.1 application that uses .NET portable libraries to target the Microsoft .NET Framework 4.5.2, you receive the following error message during compilation:
The type '{type}' is defined in an assembly that is not referenced. You must add a reference to assembly '{assembly}'

Upgrading VS2010 to 2013 introduced compile error with SendGrid

I installed the ultimate trial of Visual Studio 2013 yesterday to see if it had any negative impact on our current 2010 based projects. When trying to compile a project that previously had no problems and still compiles on my colleagues computers I encountered this error:
The type or namespace name 'SendGridMail' could not be found (are you missing a using directive or an assembly reference?)
The error is the same when run from Visual Studio 2010 or 2013
Looking at similar questions on here suggests that this happens when using the .net 4 Client Profile instead of standard .net 4, but this project has always used standard .net 4.
Another question was using the latest version of sendgrid (4.x) with .net 4 which I understand doesn't work, but we are using an older version (1.2.1).
Personally I have tried:
Removing and Readding the reference (originally it was referenced inside the project, I also tried referencing it externally)
Running Visual Studio with no addons
Recreating the project in another solution
The only luck I have had so far has been to use nuget to install the sendgrid package instead but this seems to add a lot of additional files and at the moment I'm more interested in why a previously working build has stopped working with no changes to the project other than installing another version of Visual Studio.
Edit:
This is the output when trying to build with the SendGridMail dll (succeeds since it's not used in code):
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "SendGridMail, Version=1.2.1.0, Culture=neutral, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "SendGridMail, Version=1.2.1.0, Culture=neutral, processorArchitecture=MSIL" or retarget your application to a framework version which contains "System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "SendGridMail, Version=1.2.1.0, Culture=neutral, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "System.Threading.Tasks, Version=2.5.19.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "SendGridMail, Version=1.2.1.0, Culture=neutral, processorArchitecture=MSIL" or retarget your application to a framework version which contains "System.Threading.Tasks, Version=2.5.19.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "SendGridMail, Version=1.2.1.0, Culture=neutral, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "System.Runtime, Version=2.5.19.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "SendGridMail, Version=1.2.1.0, Culture=neutral, processorArchitecture=MSIL" or retarget your application to a framework version which contains "System.Runtime, Version=2.5.19.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
I was able to resolve this by removing the .NET 4.5 SDK (but not the framework itself). I assume it was looking at the latest framework for the dlls despite the project being set to .NET 4

Found conflicts between different versions of the same assemblies

I made sure that my solution and the 10 projects are all compiled to .NET 4.5.1 but still I get this warning:
Consider app.config remapping of assembly "System.Net.Http.Formatting,
Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version
"4.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC
4\Assemblies\System.Net.Http.Formatting.dll] to Version "5.0.0.0"
[C:\TLP\packages\Microsoft.AspNet.WebApi.Client.5.0.0\lib\net45\System.Net.Http.Formatting.dll]
to solve conflict and get rid of warning.
Consider app.config remapping of assembly "System.Web.Http,
Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version
"4.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC
4\Assemblies\System.Web.Http.dll] to Version "5.0.0.0"
[C:\TLP\packages\Microsoft.AspNet.WebApi.Core.5.0.0\lib\net45\System.Web.Http.dll]
to solve conflict and get rid of warning.
My projects are not referencing anywhere the .NET 4.0 MVC assemblies System.Net.Http.Formatting and System.Web.Http.
In my Web API project I reference the assemblies in the nuget package folder not the assemblies in the C:\Program Files\Microsoft ASP.NET\ASP.NET MVC4\Assemblies\
How can I fix that?
Finally I also found the solution :p
Its before the pc...
When you search in VS in the Nuget Packet Manager (not console) for "autofac web api" you get the autofac for web api 1.0 integration. When you continue to page 3 of the search results you find the autofac web api 2 integration. Thats not fair... but I am not alone :p see the
comments:
MVC5, WebAPI2 and AutoFac not working. All Nuget packages updated

Fails to Compile C# project due to primary reference

I'm trying to compile the project with targeted framework as ".NETFramework 4.0". But I get the following warning:
The primary reference "XXX" could not be resolved because it has an
indirect dependency on the framework assembly
"System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" which could not be resolved in the
currently targeted framework. ".NETFramework,Version=v4.0". To resolve
this problem, either remove the reference "Fdi" or retarget your
application to a framework version which contains
"System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089".
I found an earlier (but similar) problem: Visual Studio 2010: Reference Assemblies Targeting Higher Framework Version
Johannes Rudolph found this answer on MSDN's forums ( http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/dfadfb34-5328-4c53-8274-931c6ae00836 ):
However, there're 2 workarounds.
Option 1:
Step1: Unload the referencing project targeting .NET 2.0
Step2: Right click the unloaded project and select edit from context menu
Step3: Add <SpecificVersion>true</SpecificVersion> to the reference.
Below is a sample from my repro solution:
<ProjectReference Include="..\HighFX\HighFX.csproj">
<Project>{8DD71CAF-BEF7-40ED-9DD0-25033CD8009D}</Project>
<Name>HighFX</Name>
<SpecificVersion>true</SpecificVersion>
</ProjectReference>
Step4: Reload the project.
Now your should be able to build within the Visual Studio 2010, there could still be a warning as below, but the build can be successful.
Warning 1 The project 'XXX' cannot be referenced. The referenced project is targeted to a higher framework version (3.5)
Option2:
Use the command line tool csc.exe to build each of your source file, which won't prevent the building.

Resources