How to add microsoft.sqlserver.smo? - asp.net

I was trying to create a new database in WebMatrix, and I was shown this error: "Could not load file or assembly "Microsoft.SqlServer.Smo, Version=11.0.0.0, Culture=Neutral, PublicKeyToken=blablabla" or one of its dependencies. System cannot find the file specified.
I am sure that there is some error in SQL Server, but I am not getting help from anyone.
I have already searched alot for this issue. But the main thing is they are all providing help solutions for Visual Studio, none of them are giving some example for web.config or should I say for WebMatrix, I know in VS its pretty simple and easy, but what about WebMatrix?
All that I came upto is somelike in web.config under assemblies, but how to connect it? Or if it is there, how to check whether the file is on system or not?
My question basically is just to know whether the file is in the system; it was installed correctly of not, and to connect it to the project to create new Databases.

Nobody helped I guess! So I tried to find the answer myself. What I found on some other forums was this:
That the dlls are found under this folder:
C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies
And to add them in your site, using WebMatrix will Require some Helper; because I use WebMatrix not Visual Studio.
So for that I will require something:
#using Helper.Name;
The issue for me was that the dll was not installed in Windows 8. And was not able to run so the exception showed up.

Related

Installed nuget package depends on older version of System.Web.Mvc.dll after Publish

I have an MVC4 application developed with Visual Studio 2010.
Project works fine on IIS Express.
When publishing it to IIS8 and trying to access it I get an exception saying the System.Web.Mvc, Version=3.0.0.0 assembly could not be loaded.
The calling assembly is AttributeRouting.Web.Mvc, which is a NuGet package I use.
The way I understand it, my project referes to version 4.0.0.0 of System.Web.Mvc, while the package I'm using depends on 3.0.0.0.
If Visual Studio/IIS Express can run it perfectly, how come the published version has this problem?
I read a lot only today, but still couldn't figure it out.
Is this what Binding Redirect used for?
I'm kind'a lost here, feeling like I don't really have any direction.
Any advice is welcomed.
Thanks in advance,
Shy.
SOLVED:
I simply (Well it wasn't so simple) installed MVC3 in addition to versions 2 and 4.
Problem disappeared without the need of any further changes.
Solution:
Download and install MVC3 from Microsoft's website.
In case installation failes:
Extract the setup file.
Open ParameterInfo.Xml in an editor.
Remove completely the <Exe> tag that refers to the vs10-kb2483190
file.
Run setup again.
Thank you very much for your help #Augusto.
Hope this helps someone someday :)

ASP.net and devexpress scheduler, works local, does not work live

Hi guys I got some code here thats buggin me.
ive managed to create a page and get it working on local host, but when i publish this to go live and nav to the web page it comes up with this error.
Could not load file or assembly 'DevExpress.Web.v11.1,
Version=11.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a' or
one of its dependencies. The system cannot find the file specified.
(E:\web\shafteccom0\htdocs\Calendar\web.config line 44).
Ive tried adding all the references, and i mean all of the dev express ones, including ones i dont even need.
my project is a web project using visual studio 10, asp.net,C# & .Net version 3.5
ive also tried changing the .net version to 2.0, 3.0 and 4.0 but no luck.
If you need my code let me know and ill edit this.
Many thanks
That error means that the library that your application is looking for does not exist on the server you are deploying it to (or it cannot load it with the variables provided). Does the live server have the VS2010 references installed to it?
Just making sure: Are you sure your references set to "CopyLocal"?
I think DevEx installs it's assemblies in the GAC, so your local copy may be working but not when you deploy. Have you tried looking in the bin on the publish location to see if they are actually there?

Could not load file or assembly 'Microsoft.Windows.Design.Extensibility'?

Strange. I am trying to deploy my application, normally there is not problems but recently i played with adding LINQ2SQL to the project and adding Entity Framework.. but removed them. Now when i try to deploy to my server, running it i am getting this error.. and i can't find a way to fix it ! I never used this assembly.. but i suspect Entity Framework or LINQ2SQL to have caused this.
Could not load file or assembly
'Microsoft.Windows.Design.Extensibility, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its
dependencies. The system cannot find the file specified.
Additional infos:
I am using a Website project and not
a web application project.
I am
using DevExpress but i added all
their dll to the bin folder and that
never caused any problems.
Any ideas ?
Thanks!
I had this issue and solved it by removing the DevExpress.Xpf dlls from the bin folder after reading a comment on this DevExpress thread
This DLL is part of Visual Studio. You should be able to add it through Add Reference > Assemblies
Hover over the name to see where the location is and pick the one corresponding to your version of Visual Studio.

Could not load file or assembly 'Microsoft.Exchange.WebServices, Version=14.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

I'm working on a project that accesses the Exchange Server. Before I replaced the project to a server, everything went fine. But now I'm getting this error.
I don't find what I search in Google, so I hope someone of you can help me. I appreciate that.
You should provide the specified assembly with your application or install it on your server.
The answer is: I copied the dll and xml file (which you get when installing EWS Managed API) to the bin-folder of my project. And it works!
I had the same exact error, in VS2005, .Net 2 and 3.5
This is how I resolved it, and I had to find another solution, because this always failed and Windows would not let me register the DLL.
regsvr32 "C:\Program Files\Microsoft\Exchange\Web services\1.1\Microsoft.Exchange.WebServices.dll"
I went into the .Net Framework Configuration Wizard from Administration tools in Windows XP. Mine is .NET Framework 2.0 Configuration (version 2.0.50727.42).
I then went into Runtime Security Policy -> Increase Assembly Trust and pointed to the above DLL in my C drive. It was set to NO TRUST, for some reason! I changed it to FULL TRUST.
I then closed and re-opened my VS2005 project and everything is now working fine.
Regards,

.Net picking wrong referenced assembly version

I just copied an existing project to a brand new machine to start developing on it and have run into a problem with the version of one of my referenced assemblies (a telerik DLL as it happens).
The project originally referenced an older version of the assembly (lets call it v1.0.0.0). My new machine has the latest version of the assembly installed, so I thought I'd updated it (lets call the new version v2.0.0.0).
Now here's the problem: If I copy the old v1.0.0.0 dll to the project folder and add it as a reference, the web site launches without a problem. If I delete that reference (and also delete the old DLL from my system) and add the new version (v2.0.0.0), the page shows the following exception:
Could not load file or assembly
'XXXXXX, Version=1.0.0.0,
Culture=neutral,
PublicKeyToken=121fae78165ba3d4' or
one of its dependencies. The located
assembly's manifest definition does
not match the assembly reference.
(Exception from HRESULT: 0x80131040)
Clearly, the code is looking for the out of date version and can't find it. But why?
I greped the solution folder for that version number and couldn't find a single reference. I double checked the text of the .csproj file and found the version correctly shows the latest version and the HintPath correctly shows the path to the new DLL. Furthermore, because I didn't install the old DLL on the system it doesn't show up in my GAC (though v2.0.0.0 does, as expected).
I then enabled the fusion log viewer to try to figure out why it's looking for that old version, but no luck:
Assembly Load Trace: The following information can be helpful to determine why the assembly 'XXXXXX, Version=1.0.0.0, Culture=neutral, PublicKeyToken=121fae78165ba3d4' could not be loaded.
=== Pre-bind state information ===
LOG: User = MyComp\me
LOG: DisplayName = XXXXXX, Version=1.0.0.0, Culture=neutral, PublicKeyToken=121fae78165ba3d4
(Fully-specified)
LOG: Appbase = file:///d:/My Documents/Visual Studio 2010/Projects/CoolProj/WebApp/
LOG: Initial PrivatePath = d:\My Documents\Visual Studio 2010\Projects\CoolProj\WebApp\bin
Calling assembly : WebApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: d:\My Documents\Visual Studio 2010\Projects\CoolProj\WebApp\web.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: XXXXXX, Version=1.0.0.0, Culture=neutral, PublicKeyToken=121fae78165ba3d4
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/90233b18/10d54998/XXXXXX.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/90233b18/10d54998/XXXXXX/XXXXXX.DLL.
LOG: Attempting download of new URL file:///d:/My Documents/Visual Studio 2010/Projects/CoolProj/WebApp/bin/XXXXXX.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
All it says it that it starts by looking for that old assembly. I have tried to find a solution online and saw this similar SO question, but it seems to be the exact opposite of my problem. That questioner's program was finding the wrong DLL instead of the referenced one. Whereas my problem is that the program is mysteriously looking for the wrong DLL and unable to find it when the right one can be found locally in the bin folder and in the GAC.
Why is mine looking for the old version? Where else can I search to find this bad reference?
My guess is that another assembly you are using is referencing the old dll. Are you familiar with all of the other project references being used and do any of them have a reference to the Telerik dlls?
Can you put in a binding redirect in your web.config file like this?
<dependentAssembly>
<assemblyIdentity name="Telerik" publicKeyToken="121fae78165ba3d4"/>
<bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/>
</dependentAssembly>
I tried most of the answers but still couldn't get it to work. This worked for me:
right click on reference -> properties -> change 'Specific Version' to false.
Hope this Helps.
I'm with Chris Conway on this one (upvoted him). The problem is that you are referencing one of the telerik assemblies in your project which references another one that isn't there.
First thing: I wouldn't install ANY vendor (ie: telerik) assemblies into the GAC. Telerik's stuff is compiled down to just two assemblies anyway (telerik.web.design and telerik.web.ui). Just deploy those with the application.
Second, in each of your .proj files (like .csproj) there is going to be a <reference include..> which points to the Telerik.Web.UI file. This normally contains a version number. Make sure the assembly you put in the bin folder matches that version.
Third, make sure ALL of your projects use the latest assembly. Also make sure they are grabbing the assembly from a local path instead of the GAC. (I really really don't like the GAC. It has caused no end of issues on some projects I've been on). We typically have an "Assemblies" folder that all projects use for external assembly references.
Fourth, visual studio automatically searches your gac everytime a web site project is loaded and retargets the assembly locations if it finds something in the gac. I can't remember if it ever does this for web application projects, but I haven't had the issue in a long time with those. This can cause similar issues during deployment.
Fifth, you can rebind version numbers for assemblies in the web.config. In the runtime/assemblybinding section you can use something like the following which takes every telerik assembly deployed in 2008 forward and points it to a very particular version:
<dependentAssembly>
<assemblyIdentity name="Telerik.Web.UI" publicKeyToken="121fae78165ba3d4" />
<bindingRedirect oldVersion="2008.0.0.0-2020.0.0.0" newVersion="2010.02.0713.35" />
</dependentAssembly>
Try:
cleaning temporary project files
cleaning build and obj files
cleaning old versions installed at
C:\Users\USERNAME\.nuget\packages\
That worked for me.
Go to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG
Find machine.config file
open in notepad
find conflict dll
Remove this and save.
compilation assemblies
addassembly=dllName,Version=1.0.0000.0000 Culture=neutral,PublicKeyToken="QWEWQERWETERY"
assemblies compilation
works for me.
This isn't a clear answer as to why, but we had this problem, here's our circumstances and what solved it:
Dev 1:
Solution contains Project A referencing a NuGet Package, and an MVC project referencing Project A. Enabled NuGet Package Restore, then updated the NuGet package. Got a runtime error complaining the NuGet lib can't be found - but the error is it looking for the older, non-updated version. Solution (and this is ridiculous): Set a breakpoint on the first line of code in the MVC project that calls Project A. Step in with F11. Solved - never had a problem again.
Dev 2:
Same solution and projects, but the magic set breakpoint and step in solution doesn't work. Looked everywhere for version redirects or other bad references to this Nuget package, removed package and reinstalled it, wiped bin, obj, Asp.Net Temp, nothing solved it. Finally, renamed Project A, ran the MVC project - fixed. Renamed it back to its original name, it stayed fixed.
I don't have any explanation for why that worked, but it did get us out of a serious lurch.
Do you have any other projects in that solution ?(may be another project was referencing an old version) Usually in VS, dll dependency spans all projects in the solution.
I had a similar issue and I had to delete everything from the bin and obj folders and rebuild to get past my issue. Hope this helps.
My problem was that the old assemblies were in the _bin_deployableAssemblies folder under the Web Application.
This meant the old assemblies were overwriting the GAC assemblies when building the project.
In case is saves someone else 3 hours... my case was a bit different. My code used DevExpress v11.1 v11.1.4.0. I had it all referenced correctly in my code. But .net memory profiler installed DevExpress v11.1 v11.1.12.0 in the GAC. In fact it wasn't the components I referenced but the ones they referenced internally that failed. Try as I might, the GAC is always checked first. It compiled and ran fine but I couldn't view the win forms designer and the stack trace was no help at all. Finally uninstalled .net memory profiler and all was restored.
This error was somewhat misleading - I was loading some DLLs that required x64 architecture to be specified. In the .csproj file:
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-ABC|AnyCPU'">
<OutputPath>bin\Release-ABC</OutputPath>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
A missing PlatformTarget caused this error.
I was getting:
Could not load file or assembly 'XXX-new-3.3.0.0' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
It was because I changed the name of the assembly from XXX.dll to XXX-new-3.3.0.0.dll. Reverting name back to the original fixed the error.
If you are experiencing this problem when testing and/or debugging the application from the Visual Studio environment (ASP.NET Development Server), it is necessary to delete all temporary files on the development website folder. To know where that folder is, look for the ASP.NET Development Server icon on the Windows tray icon (it should have a title like this: ASP.NET Development Server - Port ####), right click the icon and select Show Details; thn, the field Physical path will tell you what the temporary folder is, all items there should be deleted to solve the problem. Build and run again the website and the problem should be solved (again, solved for the Development Environment).
I had the same problem with different assemblies referencing different versions of Newtonsoft.json. The solution that worked for me was running update-package from Nuget Package Manager Console.
Its almost like you have to wipe out your computer to get rid of the old dll. I have already tried everything above and then I went the extra step of just deleting every instance of the .DLL file that was on my computer and removing every reference from the application. However, it still compiles just fine and when it runs it is referencing the dll functions just fine. I'm starting to wonder if it is referencing it from a network drive somehwere.
I had the same message when switching between two versions of an application that referenced different versions of the same DLL. Although I was testing in different folders I accidentally copied the newer version over the older version.
So the first thing to check is the version of the referenced DLL in the application's folder. Just in case.
Maybe this helps or maybe not. I cleaned my debug and release versions then I renamed the OBJ folder. This finally got me thorugh. Previous steps were basically project removing references and them adding them back in at the project properties.
In My Visual Studio 2015, I ensured that the offending Visual Studio Project's Reference Paths List is empty:
This is what worked for me:
I was using the Microsoft.IdentityModel.Clients.ActiveDirectory version 3.19 in a class library project but only had version 2.22 installed in the actual ASP.NET Web Application project. Upgrading to 3.19 in the web app project got me past the error.
In my case i had 3 projects, 1 main project and 2 sub projects referenced by main project.. So i updated the main project, leaving out sub project. That's where the conflict was. After i updated all my project everything worked just fine.
In VS2017, have tried all the above solution but nothing works. We are using Azure devops for versioning.
From the teams explorer > Source Control Explorer
Select the project which driving you nuts for a long time
Right click the branch or solution > Advanced > get specific version
Then make sure You have ticked the checkbox of overwrite files as per screenshot
In my case, I accidentally chose the wrong version of the Telerik package from nuget, which nuget then replaced every package i referenced with the incorrect version. It then inserted a binding redirect to the incorrect version so that even after I replaced everything with the correct version, it was still looking for the incorrect version.

Resources