I installed VS.2017 Enterprise and start a web performance project. When I try to add a Web performance test to the project I receive the error:
"The Web test could not be loaded: Could not load the type
'Microsoft.VisualStudio.TestTools.WebTesting.SharepointInformation'
from assembly 'Microsoft.VisualStudio.QualityTools.WebTestFramework'
Version=10.0.0.0, .."
TL;DR:
Check installed prerequisites in the latter part of Create a web performance and load test project
In my case, replacing original file
C:\windows\assembly\GAC_MSIL\Microsoft.VisualStudio.QualityTools.WebTestFramework\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.QualityTools.WebTestFramework.dll
with
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ReferenceAssemblies\v4.0\Microsoft.VisualStudio.QualityTools.WebTestFramework.dll solved the problem.
I tackled the same issue. Every time I created Web Performance and Load Test Project in Visual Studio 2017 Enterprise (with arbitrary .NET framework version) I got the same error when I tried to open *.webtest file. VS's user interface seemed incomplete and clicking on toolbars sometimes shown null exceptions.
At first, I thought I have incomplete installation, according to Create a web performance and load test project. I have even tried to completely uninstall and reinstall mentioned packages. Unfortunately, this did not help. I have also experimented with adding and removing reference to Microsoft.VisualStudio.QualityTools.WebTestFramework as there are several options in my reference browser, but without success.
There is not much information about WebTesting.SharepointInformation namespace. After a while, I discovered the existence of Microsoft.VisualStudio.QualityTools.WebTest.SharePoint.dll and after closer inspection, I have noticed that it references QualityTools.WebTestFramework assembly in C:\Windows\assembly\... that has the same assembly version and public key token, yet smaller in size compared to the one that is contained in VS 2017 installation. I have replaced it with VS2017's one and voila, *.webtest can be successfully opened.
The above answer is correct but the problem is the directory isn't accessible in my case due to some reasons so I just open my cmd and run this command. Just run, it will copy the file, but first turn of the vs.
copy "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ReferenceAssemblies\v4.0\Microsoft.VisualStudio.QualityTools.WebTestFramework.dll" "C:\windows\assembly\GAC_MSIL\Microsoft.VisualStudio.QualityTools.WebTestFramework\10.0.0.0__b03f5f7f11d50a3a"
I am trying to use SpecsFor MVC for automated acceptance testing and I have noticed that it is not building / publishing project correctly on Visual Studio 2012 and hence IIS Express is not running, ending in a 'Page cannot be displayed' message throughout the automated acceptance test.
To take you through all my tests to get this working, initially, when trying to run the automated tests, I was getting a 'Build Failed' message when running
_host = new SpecsForIntegrationHost(config);
_host.Start();
. After loading the SpecsFor MVC source code, I have noticed that the error was because the MSBuild.exe process was failing and the output message was being written to Console.Output. After checking the output, I have noticed that the error was that the Microsoft.WebApplication.targets was not found. After some research, I found the below:
External VS2013 build error "error MSB4019: The imported project <path> was not found"
The one with most votes spoke about removing the <PropertyGroup> node from the .csproj which after removing it, the MSBuild.exe was not exiting with an error code as it only had warnings which still resulted in the project not being built & published correctly. SpecsFor MVC in this case treated this scenario as successful and proceeded with launching IIS Express but since the project was not built successfully, the acceptance tests resulted in another Page Cannot Be Displayed message as IIS Express was not running correctly.
After some further research, I found v11.0\WebApplications\Microsoft.WebApplication.targets was not found when file actually references v10 which outlined that VS 2012 has a new different MSBuild.exe file located in C:\Program Files (x86)\MSBuild\12.0\Bin.
Now the issue is that within the SpecsFor MVC IISTestRunnerAction.PublishSite() method, the path of the MSBuild.exe is being loaded through
System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() which in my case is outputting C:\Windows\Microsoft.NET\Framework64\v4.0.30319\. Changing this manually to C:\Program Files (x86)\MSBuild\12.0\Bin solved the issue and project was built & published successfully.
My final question is: Is there a way where one can change the value of System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() so that I wouldn't need to update the source of the SpecsFor MVC project?
Thanks in advance for any help!
As of SpecsFor.Mvc 3.2.0-rc01 (still a preview release as of right now), you can configure the path to MSBuild like so:
var config = new SpecsForMvcConfig();
config.UseIISExpress()
.With(Project.Named("SpecsFor.Mvc.Demo"))
.CleanupPublishedFiles()
//Set the full path to MSBuild.exe here!
.UseMSBuildExecutableAt(#"C:\Program Files (x86)\MSBuild\12.0\Bin\msbuild.exe")
.ApplyWebConfigTransformForConfig("Test");
To understand how these ".targets" files are organized in Visual Studio is a challenge. I don't know nothing about this SpecsFor MVC works, but if you put the right ".targets" file in it's path, it should work. By your question, I understand that SpecsFor invokes MSBuild internally.
It's a similar problem when you install a new build machine, and a lot of Visual Studio componentes are missing. Not all of them are deployed with the framework. Some comes with Visual Studio separated installers other with specific componentes.
I didn't find an specific installer that deploys this needed file. I just found the MSBuild 2012 installer (http://www.microsoft.com/en-us/download/details.aspx?id=40760), and I don't know if it deploys the previous version .targets.
And also you can try the ASP.NET MVC installer for your specific version.
Another approach is try to find a parameter in SpecsFor to see which version of MSBuild it is invoking. Probably if it uses the version in Program Files\v12, it should work.
On my ASP.net site I have a reference to Microsoft.SQLserver.SMO. I copied this reference onto my production server and got a could not load error for Microsoft.SqlServer.Management.Sdk.Sfc. This error was fixed by copying the dll from the
C:\Program files\Microsoft Sql Server\110\SDK\Assembilies
However I then got the same error but for Microsoft.SqlServer.SqlClrProvider which is nowhere to be found.
Where can I find the SqlClrProvider dll? It works on my localhost so it must be somewhere.
On your development machine or a machine where you have SQL Server installed, the Microsoft.SqlServer.SqlClrProvider.dll file is in your GAC. However, you cannot copy this file without making changes to the registry.
Using the registry editor, go to HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Fusion. Add a new DWORD called DisableCacheViewer. Give it a value of 1.
Once this change is made, you can go to C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.SqlClrProvider\ to get the dll you need.
To see a more detailed explanation, follow one of these links:
HOW TO RESOLVE “SQLCLRPROVIDER NOT FOUND” WITHOUT INSTALLING SQL SERVER ON THE CLIENT MACHINE OR NEEDING A DEPLOYMENT PROJECT
Could not load file or assembly Microsoft.SqlServer.SqlClrProvider
I wanted to make an embedded script in powershell and stumble upon your same problem.
The thing is that Microsoft.SqlServer.SqlClrProvider.dll is not installed in SQL files but in windows assembly.
Assembly folder is special: you can't copy anything with windows UI.
I just needed the Microsoft.SqlServer.SqlClrProvider.dll so that I can load it in my script like that:
[System.Reflection.Assembly]::LoadFile($scriptPath+"dll\Microsoft.SqlServer.SqlClrProvider.dll") | out-null
to copy it you can do the following:
c:\>cd c:\Windows\assembly
c:\Windows\assembly>dir /s Microsoft.SqlServer.SqlClrProvider.dll
# here you get the directory and the file
c:\Windows\assembly>copy c:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.SqlClrProvider\<version>\Microsoft.SqlServer.SqlClrProvider.dll c:\Users\Administrator\Desktop\
you want to do that on a machine with SQLserver installed otherwise you may not find it.
It's just a workaround. I guess it's not the best thing to do if you need to execute your script in different environments.
hth
Copying SqlClrProvider dll into sqlserver Binn directory didn't help in my case.
Cause:
It was cause by using different versions of SQLServer on production machine and target machine.
Solution:
Make sure you are using the same version of SMO libraries as you have on the target machines. If there is SQLServer2008 on the target machine you must use v10 libraries otherwise you would get this error.
MoreDetails:
SqlServer on my target machines was version 2008 (10) and I had SqlServer2014 (12) on my own machine. When I used SMO library visualstudio added v12 libraries (Microsoft.SqlServer.SMO, ...) but smo is just a shell which use SqlClrProvider and it expects to have SqlClrProvider of same version on system assemblies. this caused the application to crash on the target machine since the v12 of SqlClrProvider didn't exist. By using v10 smo libraries I solved the problem
Had the same issue but for version 11. To get the right assemblies installed a did the following steps:
Check what version is expected: https://sqlserverbuilds.blogspot.com/. Version 11 => sql server 2012
Download Microsoft's web platform installer and install it
Search for 'sql server 2012' and install one or all of the following:
The first thing you need to do is disable the GAC Shell extension which allows you to browse the GAC, to do this:
Open “regedit”
Navigate to
HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Fusion
Add a new DWORD or 32
bit DWORD named DisableCacheViewer with the Hex value of 0x1 or a
decimal value of 1
That disables the GAC Shell allowing you to fully browse assembly folder, now we can extract the assembly from the GAC and drop it into the bin folder or the dll location on the client machine.
Go to C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.SqlClrProvider\
You may notice more than folder here, this is for each version of SQL server you have installed
For SQL 2012 it will be : \11.0.0.0__89845dcd8080cc91
You will then find the file Microsoft.SqlServer.SqlClrProvider.dll
Reference
I could not solve my issue, while using Microsoft.Sqlerver.SMO reference. So I instead used the System.Data.Sql.SqlDataSourceEnumerator class for all my Sql functionality needs.
For people googling this error, and arriving here, there is another possibility. Go into Services, and make sure that your SQL Server process can run. On my machine, the password for the user account had changed. Once I fixed the password, the process started, and I no longer received the above error.
I have .net framework 4.0 (and older versions, i.e. multiple versions) installed, want to use the command line compiler for C#
C:\>csc.exe
Now I found across few forums using the direct path I can use the compiler, also using batch file one can do that,
I need to set environment variables LINK but that is part of visual studio(if VS is installed then only it works) I want to use the compiler from the redistributable .net framework(using command line only) which is free to use and distribute.
Do not want to install Visual Studio in the system where I run the code.
my Current CSC.exe file location PATH is
C:\Windows\Microsoft.NET\Framework\v4.0.30319
This path and compiler file works fine but every time I have written like this and some times I have seen an error related to Library.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe sample.cs
How to avoid writing long path each time while testing the sample codes?
Please provide best available alternate(Batch file or something)
Edit 1: Setting Path:
Paul's answer is works fine with simple program, But the issue with that is if there are any Library files used/added, were not found in this case.
Note: Version is not a constraint actually, we may use any .net redistributable version. Just CSC.exe should accessible from any path without any issue(example library files used).
if you are using a batch file add to the start
set PATH=C:\Windows\Microsoft.NET\Framework\v4.0.30319\;%PATH%
This will add the .net framework to the start of your path for the current run of the batch file only.
now your batch file can just use
csc.exe sample.cs
Got the working answer from one of the forums, for the complete solution to build with reference added.
We need to use /r option with compilation.
First add path using command below.
Example:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /t:exe /out:sample.exe sample.cs /r:ReferenceName.dll
After adding Path:
C:\test>csc /t:exe /out:sample.exe sample.cs /r:ReferenceName.dll
This solved my problem with reference.
Note: if reference is not in same directory as CS file it need to be added with its path.
Recently I met the following exception at C# solution:
Error 2 Could not load file or assembly 'Newtonsoft.Json,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=b9a188c8922137c6' or
one of its dependencies. The parameter is incorrect. (Exception from
HRESULT: 0x80070057 (E_INVALIDARG))
This does not depend either on my code or on the name of assembly (like Newtonsoft.Json in this case).
When I delete this dll from the solution the compiler tells about another in the same exception. So I suppose something shoud be turned off/on at my PC :)
Looks like a corrupted assembly being referenced.
Clear both:
the \bin folder of your project
the temp folder (should be C:\Users\your_username\AppData\Local\Temp\Temporary ASP.NET Files in windows 7)
and see if the error still happens
Depending on if your are running X64 you might need to clean up a couple more spots. Just cleaning up my user directory was not enough.
%TEMP%\Temporary ASP.NET Files
C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files
This list will grow as if you have other versions of the framework installed.
I had to clear
C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files
Only then did the issue get resolved.
To know what to clear for sure - add the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion\EnableLog (DWord set to 1).
Then you will see output like below. This tells you where asp.net is attempting to load your DLLs. Clear this directory.
LOG: This bind starts in default load context.
LOG: Using application configuration file: c:\app\AtlasAdvisor\web\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL **file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/3c8629f7/dfa387b6/Avanade.ViddlerNet.DLL.**
LOG: Attempting download of new URL **file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/3c8629f7/dfa387b6/Avanade.ViddlerNet/Avanade.ViddlerNet.DLL**.
Clear out the temporary framework files for your project in:-
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\
You can also clear the packages directory and allow NuGet to re-download missing packages
it solved the issue for me
Delete all files from these folders .
C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files
C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET
Files
Getting fresh set of binaries from Source control helped.
Thanks
Just clear this folder: (only windows x64)
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
Thanks Alex your second point helped me fix this.
It appears that unless you run visual studio as an administrator in Windows 7 it stores your temp files locally rather than C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files.
See following blog post: http://www.dotnetscraps.com/dotnetscraps/post/Location-of-Temporary-ASPNET-files-in-Vista-or-Windows-7.aspx
I had the same issue here - above solutions didn't work. Problem was with ActionMailer. I ran the following uninstall and install nuget commands
uninstall-package ActionMailer
install-package ActionMailer
Resolved my problems, hopefully will help someone else.
This can happen while referencing COM wrapper dlls. Within your Visual Studio Project, under References, select the COM wrapper dlls being referenced and ensure they have the the following property values: "Embed Interop Types": False and "Specific Version": False.
I just delete my application temp data from this path
C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files
Problem resolve
I see lot of techies have posted about clearing temporary directories of ASP .Net run-time pertaining to each and every .Net framework hosted on your machine as in this answer. But I believe we should know the clear-cut logistics as to why we need to blindly clear all of temporary working directories of all .Net frameworks. According to me, it should not be the case.
My advice would be that you should try a pin pointed directory clearing approach to resolve this issue. How would you know which directory to clear?
Go to IIS and right click on your website node in left navigation pane to open the context menu. In the context menu point to Manage Application -> Advanced Settings... to open the Advanced Settings window.
Check the Application Pool your website is assigned to. In my case it is DefaultAppPool as shown below:
Now go to Application Pools node in left navigation bar in the IIS. Now check that which .Net CLR Version is being run by your app pool. In my case it is v4.0 as shown below:
Since the CLR version being hosted by my app pool is v4.0, so I prcisely cleared only the temporary files in the folder pertaining to ASP .NET v4.0 only as below:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files
And that's it. My problem got resolved.
Lesson learnt: This is indicative of the fact that all the temporary files being used by your website aren't scattered across several directories but they are at once place being referred by your app pool. So you need to clear that specific folder only.
Clearing C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files worked for me. Thinking of automating the deletion process to avoid the issue in future.
If you are using SQL Server 2012's Data Tools, which uses the VS2010 shell as at May 1 2013, check your Configuration Manager settings. A server name change from Workflow to xCPWorkflow was enough to produce the exact same The parameter is incorrect (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) message.
You can either clean, build or rebuild your application or simply delete Temporary ASP.NET Files at C:\Users\YOUR USERNAME\AppData\Local\Temp
This works like magic. In my case i had an assembly binding issue saying Could not load file bla bla bla
you can also see solution 2 as http://www.codeproject.com/Articles/663453/Understanding-Clean-Build-and-Rebuild-in-Visual-St
I had this problem when making controller in MVC. I changed version .net framework. The problem was solved
The problem relates to the .Net runtime version of a referenced class library (expaned references, select the library and check the "Runtime Version". I had a problem with Antlr3.Runtime, after upgrading my visual studio project to v4.5. I used NuGet to uninstall Microsoft ASP.NET Web Optimisation Framework (due to a chain of dependencies that prevented me from uninstalling Antlr3 directly)
I then used NuGet to reinstall the Microsoft ASP.NET Web Optimisation Framework. This reinstalled the correct runtime versions.
In my case i wanted to compile a COM visible DLL. The problem was that an older version of this DLL was located here:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
Thus Visual Studio loaded this version instead of the newly compiled one, as it tried to register it.
Clear all files from temporary folder (C:\Users\user_name\AppData\Local\Temp\Temporary ASP.NET Files\project folder)
Sometimes you, also, need to clean this folder: C:\Windows\Temp\Temporary ASP.NET
I faced same error because application didn't find dependent frameworks in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\ folder. I just repair my Visual studio which added required framework in above location and it working fine.
In my case, changing the IISExpress port number in my project properties, solved the problem.
If anyone else out there is using the WiX toolset, I discovered that my installer project had a reference to an old project that had recently been removed from the solution. Took me a while to realize since there are a number of projects in the solution I was attempting to build and the message did not indicate which project was failing to build (and clean, which was failing as well).
I had users of Siemens Teamcenter 10 Client for Microsoft Office getting the same error about a different DLL. None of the other answers worked. The solution was to delete the folders in
C:\Users\%username%\AppData\Local\assembly\
I Had the similar issue while opening Nuget Packet manager,
I removed all the temp files and build the project, it worked fine.
I had the same issue with "Chocolatey Server (Simple)" running on IIS and had to do the following steps
Clean the "C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files" as recommended
Uninstall the "Chocolatey Server (Simple)" application via choco
Remove the directory "C:\tools\chocolatey.server" from the chocolatey package directory. Important, because otherwise Web.config is holding old dependencies which leads to the error. A simple re-installation will not update an existing Web.config (as it was in my case).
Restart IIS and config Chocolatey Server as recommended by the authors. The chocolatey server page should now be visible without any errors.