Visual studio can not find a specific reference even though it exists - reference

I am setting up a Sitecore project and when I try to view the website in the Browser I get the following error message:
Could not load file or assembly 'Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5' or one of its dependencies. The system cannot find the file specified.
I understand the error, however, I am not sure why it is being thrown. Since I have included this reference for this project. I want answers of how you have overcome this error. Thanks

This is likely because you have the wrong version of the Owin.dll.
Though Sitecore out of the box doesn't depend on the Owin.dll there are some third party modules that rely on this dll particularly when concerning authentication.
I would check that you have not overwritten another version of the dll when you published the Visual Studio project to the website.
If you have binaries that depend on different versions of assemblies you can use Assembly binding redirects to target the correct version of the dll.

Related

Failed to resolve System.Void UIKit.UITableView in Xamarin iOS

If I build my Visual Studio project for Xamarin.iOS with the Linker Behaviour set to "Don't Link", everything works fine except the resultant IPA file is 30MB (which expands to 101MB on the app store!).
If I change the Linker Behaviour to anything else (Link All or Link SDK) then I receive the following compile error;
Error 32 Failed to resolve "System.Void UIKit.UITableView::set_DataSource(UIKit.UITableViewDataSource)" reference from "Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065"
I want to use the linker so that the size of the project comes down to a respectable size. Can anyone elp with this error?
The issue was because your older version of sqlite was based on an older (preview) version of the unified API.
Some API signatures changed like, in the case, to allow using protocols more easily (which means using interfaces instead of types).
Note that turning off the linker will remove the build failure - but that symbol is still missing and you can run into this at runtime (which is worse since you'll need to test carefully to ensure that does not get hit).
I removed the reference to sqlite and re-added it again through nuget. This resolved the issue.

Can't find System.Windows MvvmCross xamarin iOS

When I build for the iPhone simulator all seems to work fine. However, when I build for the iPhone, I get messages saying the following -
Warning MT3005: The dependency 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' of the assembly 'Cirrious.CrossCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e16445fd9b451819' was not found. Please review the project's references. (MT3005) (IMI.Webstore.Mobile)
This worked with previous versions of Xamarin but the current beta release seems to have broken something. Any ideas?
After reviewing the build log further, it actually wasn't a problem with finding that particular dll, even though there were warnings about it.
The issue was actually with some directory permissions due to a some what complicated windows VM setup. I ended up cloning a copy of the code base into a different directory and the issue sorted itself out. PHEW!
You need to reference System.Windows in your Touch Project.

Why VS2012 project with referenced assembly can't target 4.0 automatically

In a Visual Studio 2012 C# console application, I downgrade ".NET Framework Target" from 4.5 to 4.0. Win 7 Pro with both Frameworks installed.
I then reference an assembly, which, through warnings complains the following:
The primary reference "System.Threading.Tasks.Dataflow, Version=4.0.0.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.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 "System.Threading.Tasks.Dataflow, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" or retarget your application to a framework version which contains "System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
If I try to compile at this point, I error, becuase types and namespaces from referenced assembly aren't available, as if the assembly was not referenced at all.
The "Add Reference" dialog doesn't have any System.Runtime choice, but if I manually brose to
C:\Windows\Microsoft.NET\Framework\v4.0.30319\
and reference the System.Runtime assembly found there, warnings go away and I am able to compile.
Questions:
Is such forcing of the System.Runtime version a potential issue down the road (deployment).
If VS Project properties are seto to target Framework 4.0 (doesn't that relate to targeting the 4.0 SystemRuntime/CLR), why isn't the refferenced DLL picking that up and why manually adding the reference to my project fixes that issue?
Even though the library System.Runtime is inside the C:\Windows\Microsoft.NET\Framework\v4.0.30319\ directory, it is not part of the .NET 4.0 framework. .NET 4.5 is an in-place update of 4.0 and is installed in the same folder with the same version number.
Here is a screenshot that proofs that the library does not exist on a play .NET 4.0 installation:
You can also validate this by browsing to the C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework directory where you find the original assemblies for all installed framework versions. You will find the System.Runtime.dll as part of the .NETCore\v4.5 and .NETPortable\v4.5 subdirectories.
The reason that you can add the library to your project is that the runtime did not change between 4.0 and 4.5, so Visual Studio doesn't know or even care that the library you added manually is installed by 4.5. In this case the targetting in Visual Studio is only a filter that avoids that you accidentally add a 4.5 assembly to a project that targets 4.0.
Additional information:
Rick Strahl has a very good blog post on the topic with a more detailed analysis:
http://www.west-wind.com/weblog/posts/2012/Mar/13/NET-45-is-an-inplace-replacement-for-NET-40
Is such forcing of the System.Runtime version a potential issue
Yes, this just won't work. It works on your machine because you have 4.5 installed. Your program will crash and burn on a client machine that only has 4.0. Never add a reference from the Framework directory. It is rather sad that they are still around, they get too many programmers in trouble, but backwards compat is sacred.
The build system can only tell you that you have a problem when you use the reference assemblies. The ones shown in the Add Reference dialog, they are stored in c:\program files\reference assemblies and are not the same as the runtime assemblies. You know that works, you did get the warning. Which, in a somewhat clumsy way, told you that you program won't work on a machine that has 4.0. Don't ignore that warning, you really do have to target 4.5 to use that assembly. Hard requirement you cannot avoid.
why isn't the refferenced DLL picking that up
Because it refuses to build a program that cannot run. Feature, not a bug.

Unit testing with portable library for Windows Phone 7 and 8

I currently have a VS2012 solution with a WP71 project and a WP8 project. Each of these projects reference a Portable Class Library project where I keep the view models. I also have a Unit Test project that references the PCL and contains tests for the view models.
The problem I'm having is when I compile the unit test project I get the following error:
error CS0012: The type 'System.Windows.Input.ICommand' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes'
All of the projects, including the unit test project, reference the Portable.MvvmLightLibs NuGet package.
After looking around for this assembly I noticed that there are different versions, one for WP8, one for Silverlight 4, etc. Out of all these versions I'm not sure which to use.
The unit test project is targeting .NET Framework 4.5, so I added the System.Windows assembly for that version which works, but I then get the following error:
error : CA0001 : Could not resolve reference to System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes
Seeing as this is a code analysis error I'm tempted to simply ignore this and carry on, but I was wondering if anyone had any ideas on how to solve this or whether it is safe to ignore it?
So, I figured a way to solve the problem.
To get the test project to compile I had to add the System.Windows.dll assembly from:
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71
But, adding it using the Add Reference dialog automatically adds the .NET 4.5 version even if I browsed directly to the folder. To fix this I opened the *.csproj for the test project and replaced the line:
<Reference Include="System.Windows"/>
with
<Reference Include="System.Windows">
<HintPath>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\System.Windows.dll</HintPath>
</Reference>
This ensured that the 2.0.5.0 version was referenced instead of the .NET 4.5 version. The problem with this approach is certain types conflict with other assemblies, namely the System.dll, but seeing as I'm only testing view models from a Portable Class Library, I'm not all that bothered.
Ideally the test project would also be a Portable Class Library, but I've not got round to testing that.
One other issue was I tend to have warnings show up as errors when building in release mode, so this always fails because there will always be a warning complaining about naming clashes with System.dll.

Issue with ReportViewer on Windows Azure websites (WAWS)

In one of my project i have used reportviewer control to display reports on web pages and at time of uploading on Azure I have followed the steps mentioned here
After uploading when i runs that report web page then it's giving me below error
An error occurred during local report processing.
The definition of the report 'Reports\Report1.rdlc' is invalid.
An unexpected error occurred in Report Processing.
Could not load file or assembly 'Microsoft.ReportViewer.ProcessingObjectModel, >
Version=10.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its
dependencies. The system cannot find the file specified.
What should be cause of this?
Update:
I have added following 2 dlls as shown in below snap
Microsoft.ReportViewer.Common.dll (10.0)
Microsoft.ReportViewer.WebForms.dll (10.0)
After long research i found solution of my problem from this link
The problem with missing reference of below dlls
Microsoft.ReportViewer.ProcessingObjectModel.dll
Microsoft.RevportViewer.DataVisualization.dll
but after instaling i could not found those dlls in C:\Windows\Microsoft.NET\assembly\GAC_MSIL
But there is assembly files available in this path C:\Windows\assembly
then i have added those dlls using VS2010 directly as shown in below fig.
And it's worked!
What is the version of ReportViewer you have used in this project and would you please specify how many and which one Reference DLL you have included in your project? This will help to ensure that you have included all the DLL properly in your project. You must use Report Viewer SP1 which is compatible with Azure DB, and the same SP1 language pack.
I would suggest FTP to your website and verify that you do have all the DLL uploaded correctly as you configure in your project. This is the best way to check in Windows Azure Websites if all the configured files made it to file server.

Resources