Azure Website missing msshrtmi when built on and deployed from TFS - tfs

I'm trying to deploy to Azure Websites (Preview) from TFS (Preview). The build works and the website is deployed but when my code tries to access the Azure RoleEnvironment the website throws the following exception:
Could not load file or assembly 'msshrtmi, Version=1.7.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its
dependencies. The system cannot find the file specified.
I've tried all solutions proposed in the following thread with no luck. I think it has do to with the TFS.
I have tested this:
Reinstalled Azure SDK and Tools
Removed all PlatformTarget from
projectfiles
Wrote post-build event to delete msshrtmi.dll
Targeted all assemblies to x64 (-> failed all unit tests
on TFS, it seems to be x86, even if allowing x64 in .testsettings)
Could not load file or assembly 'msshrtmi' or one of its dependencies (Azure Table Storage Access)
I've ran out of ideas on how to troubleshoot this issue? Does anyone have any suggestions?

I've encountered a similar issue in earlier versions of the SDK when doing some builds. My solution wasn't entirely intuitive. If I go through each of my build configurations and do a "Clean Solution" then go back to the build configuration I actually care about and do a build this issue goes away.
I have no explanation as to why this works, but after hours pulling my hair out, I was just happy to have a solution.

After 7 hours of mindblowing trial and error I finally fixed this. The problem lay with having Microsoft Windows Azure tools for June 2012 together with Microsoft Windows Azure tools for November 2011.
The steps I followed:
Remove Microsoft Windows Azure tools For Visual Studio 2012 RC - June 2012
Install Microsoft Windows Azure tools for Visual Studio 2010 - June 2012 Edition
Remove Microsoft Windows Azure tools for Visual Studio 2010 - November 2011 Edition
Now re-open the project that was trying to be deployed
Visual Studio will try to convert all the November 2011 binaries to the June 2012 edition
Once this is successfully done, re-check all the Microsoft.WindowsAzure references to see if they are version 1.7.0.0
Publish to Azure!
Hope it helps someone, I'm so tired I'm not coding for the next 24 hours.

I had the same problem where it was always looking for the 32 bit version of msshrtmi in 64bit app causing an error like this. I never found out why but I created build task in my project that would delete the offending 32bit file from the bin so 64bit is found in GAC.

Related

Nuproj alternatives for Visual Studio 2019?

We have a legacy C# and C++ solution (web services, web app, OWIN and Nancy) that was built with Visual Studio 2013. We now must use Visual Studio 2019 Enterprise. The solution has a .nuproj file that we were using with the open source nuproj github repo that has been archived and is unsupported in VS 2019. The nuproj authors have not supplied any help (from what I can see) on how to convert or migrate nuproj to a VS 2019 format.
I am wondering if anyone knows the quickest way to get this working?
Alternatives would also be appreciated.
I read:
Quickstart: Create and publish a NuGet package using Visual Studio (.NET Standard, Windows only), but I was hoping not to install .NET Core on my company laptop yet.
Automating creating NuGet package as part of build process, but I see that is eight years old.
Internet searches about csproj self-pack and dotnet pack, but again, I do not want .NET Core right now.
Nothing straightforward. I will retool and use NAnt.

Runtime error in VS 2013 Windows Azure regarding an assembly Microsoft.WindowsAzure.Storage.Emulator.Controller

I am receiving an error while trying to run my azure project on my machine, which states :
Windows Azure Tools: Could not load file or assembly 'Microsoft.WindowsAzure.Storage.Emulator.Controller, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
When I try to build/rebuild the solution, no errors are received. This appears only when I try to run the project.
Some specifications for your reference :
Using Visual Studio 2013
Using Windows Azure SDK 2.3 for VS 2013
Using SQL Server 2012
Things that I tried :
Tried setting the "Start Windows Azure Storage Emulator" property to false.
Tried changing the server from IIS express to IIS Web Server.
Tried replacing the assembly Microsoft.WindowsAzure.Storage from an old working backup.
Tried uninstalling Microsoft ASP.NET Web Tools and while reinstalling, it gave me the error "A later version of Microsoft ASP.NET and Web Tools 2013.1 - Visual Studio is already installed. Setup will now exit".
So far none have worked.
For further information, I once installed VS 2015 and its relevant Azure SDK a while back and then uninstalled it and installed VS 2012 and its corresponding Azure SDK. Note here that the project was running when I was using VS 2012. And now, I have installed VS 2013 and Azure SDK 2.3 and that error is showing up. Could this be an inception of the issue here ?
Any sort of help or guidance would be beneficial. Thanks.
This sounds like the Azure SDK does not install in your Visual Studio correctly. I would suggest you delete all version of Windows Azure Tools for Visual Studio before reinstall. Then download a new one at: https://azure.microsoft.com/en-us/downloads/.

Visual Studio Team Services doesn't get the packages folder for VS 2015 solution

Background:
I have an MVC application recently ported to Visual Studio 2015 Pro
All relevant references are set to Copy Local = True
We are using Visual Studio Team Services (previously Visual Studio Online) for our repository
I am able to compile, publish, and run the application locally without issues
All dlls contained in the \packages folder are not getting committed to Team Services and NuGet isn't fixing this on the other machines.
How do I fix this so everyone else can compile this application?
I have read many "solutions" to this problem, but none have worked. One that seems to fix the issue for many people doesn't work in VS2015 because Microsoft removed the option to automatically restore NuGet packages.
I have searched many other sites, and similar posts on Stack, but none are exactly this issue.
Please help me fix it.

VS 2015 RTM MVC not working

Here is the summary of what was going on:
I had VS 2015 RC Enterprise installed. When I tried to install VS 2015 Community over it, it was blocked because it had enterprise installed. Tried to uninstall that, said it is not really installed and if I want to just remove it from list of installed products. Uninstalled from command line with /uninstall /force, worked but the community installer still complained. Went few rounds with installing VS 2015 Enterprise RTM, uninstalling that, and then trying to install community edition, but it still thought Enterprise was installed. Finally I fired up procmon and started deleting registry entries from VS 2015 that it was referencing and finally got it to install.
So now I am here - things seem to work except MVC support:
I repaired, modified, uninstalled and installed again a few times, no joy.
ActivityLog.xml says this:
<description>CreateInstance failed for package [Microsoft.VisualStudio.Web.Mvc.Package.MvcPackage]</description>
<guid>{B54016DB-B3E6-4960-8262-81772C777DE9}</guid>
<hr>80070002</hr>
<errorinfo>Could not load file or assembly 'Microsoft.VisualStudio.Web.Mvc.5.0, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.</errorinfo>
I've run out of ideas as to what else I can do to make this work, any help is very much appreciated.
Did you ever have earlier releases than RC installed, before Ultimate was renamed to Enterprise?
If you have VS RTM (Community, Professional, or Enterprise) installed you can try the following:
Close all instances of Visual Studio
Run the following from a command prompt to forcibly remove MVC: msiexec /x {61A70737-1FE8-E16A-8791-5C8D54990F5B} IGNOREDEPENDENCIES=ALL
Open appwiz.cpl (Add/Remove Programs), click on Visual Studio 2015, select change and then select the Modify option once the installer is launched.
Thanks,
Jacques

msbuild error building sql clr dll in TFS

We have SQL CLR dll that we developed quite a long time ago that we have been using. Unfortunately it wasn't ever in our normal daily builds.We are going to be upgrade our sql server from 2008 R2 to 2014. So i opened the project and upgrade it to a visual studio 2013 project (we hadn't opened it for quite some time). I also upgrade the target framework from 3.5 to 4.5.1. Lastly i changed the target sql server version to 2014. I was able to build it locally. I then tried to add it to our TFS build and got the following error:
E:\Builds\8\TRSApps\Dev\Sources\Shared
Objects\Components\FrsSqlCLR\VB Code\FrsSqlCLR.vbproj (76): The
imported project "C:\Program Files
(x86)\MSBuild\12.0\bin\amd64\SqlServer.targets" was not found. Confirm
that the path in the declaration is correct, and that the
file exists on disk.
I was able to resolve the problem. I searched for "SqlServer.targets" locally and found it under the .net 3.5 framework folder (not under 4.x):
C:\Windows\Microsoft.NET\Framework\v3.5
I just copied it to the location it was looking for it above and it fixed the problems which leads me to my questions:
Is TFS looking for SqlServer.targets in the correct location? If so then why isn't SqlServer.targets there?
Is there something i need to install on the build machine?
Why is the file in the 3.5 framework folder and not in the 4.x framework folder
Though i was able to resolve it by copying it from the 3.5 framework folder it seem a kind of hacky solution. I want the details so in the future when we upgrade our tfs server i have all the details.
You need to install Visual Studio 2013 on the build server. Also Sql Server Data Tools for 2013.
Once you have them on the build server it should build as is.

Resources