Error TF249051 using TFS 2008, VS 2012 and Windows 8 - visual-studio-2012

I have a Addin for Visual Studio, that connect to TFS 2008 server. I use VS 2012 in Windows 7 and Windows 8 (and 8.1).
No problem using my Addin, VS 2012 and Windows 7. All is OK.
But there is authentication issue using My Addin, VS 2012 and Windows 8.
Anyway, if I use Team Explorer and Source Control in VS 2012, there's no problem.
I get the following error:
TF249051: No URL can be found that corresponds to the following server
name: myTFS_server. Verify that the server name is correct.
Full trace:
Trace DomainName: myTFS_server
Trace DomainUri: http://myTFS_server:8080/
Trace ProjectName: MyTeamProject
Trace ProjectUri: vstfs:///Classification/TeamProject/5e1c44c0-a88c-4447-b2d3-1e9191abc700
Source Control: System.__ComObject
Error in Connect to TFS: Microsoft.TeamFoundation.TeamFoundationInvalidServerNameException: TF249051: No URL can be found that corresponds to the following server name: myTFS_server. Verify that the server name is correct.
at Microsoft.TeamFoundation.Client.TfsConnection.GetFullyQualifiedUriForName(String name, String locationServiceRelativePath, Func`2 getRegisteredUri)
at Microsoft.TeamFoundation.Client.TfsTeamProjectCollection.GetFullyQualifiedUriForName(String name)
at TeamExplorerManager.TFSServer.Connect(String serverName, ICredentialsProvider credentialsProvider)
TF249051: No URL can be found that corresponds to the following server name: myTFS_server. Verify that the server name is correct.. SourceControl: http://myTFS_server:8080/vstfs:///Classification/TeamProject/5e1c44c0-a88c-4447-b2d3-1e9191abc700.
Targets {http://schemas.microsoft.com/developer/msbuild/2003}Project
*** End OnStartupComplete ***
Any suggestions about it?

My Addin will have to make use of a bindingRedirect to redirect all versions to from v10 to v11.
For example:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.TeamFoundation"
publicKeyToken="xxxxxxxxxxxxx"
culture="neutral" />
<bindingRedirect oldVersion="10.0.0.0"
newVersion="11.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.TeamFoundation.Client"
publicKeyToken="xxxxxxxxxxxxx"
culture="neutral" />
<bindingRedirect oldVersion="10.0.0.0"
newVersion="11.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Make sure to update the publicKeyToken to the correct value.
Note:
Specific version does not work if the assembly is strong name signed.
Microsoft almost certainly strong-name signed their assembly.
References:
SpecificVersion=False with TFS API dll's

Related

Deploying SP 2016 wsp to SP 2019 but resulting in error for Add-SP Solution

I have tried to Deploy SP 2016 wsp to SP 2019 but that resul in error for Add-SP Solution Input string was not in correct format at line 1.
I have opened the SP 2016 wsp in VS 2017 in an environment with the SP 2019 installed.
Also upgraded the solution when asked by VS 2017 to SP 2019.
It rebuild the wsp properly but not deploying.
Can anyone give me some idea on this?
Error which I am getting is:
Severity Code Description Project File Line Suppression State
Error CS0433 The type 'SPList' exists in both 'Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' and 'Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' Bamboo.FullTextSearch C:\Bamboo\LT200\SPX.HW11.ListSearch\dev\Bamboo.AdvanceSearchSolnDual\Bamboo.FullTextSearch\Bamboo.SimpleSearchEngine.cs 48 Active
There are lot of like this
1) Check references in your project: Microsoft.SharePoint.
2) If there is a reference and it's not corrupted, check the version by opening library properties.
2.1) If you have referenced a newer version, add an assembly binding with bindingRedirect in app config, for example:
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.SharePoint" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="15.0.0.0" newVersion="16.0.0.0" />
</dependentAssembly>
</assemblyBinding>
3) Enable the Fusion log How to enable assembly bind failure logging (Fusion) in .NET and read the logs.

Web API configurations work in debug but not in iis

I'm making a Web API project and I'm using iis.
I made the project and then I needed to add bundling to it. I used system.web.optimization file and webgreas DLLs from the default MVC project that is created by visual studio. There was an error for the required version of the webgreas DLL and I had to add the following configurations to the web.config file and it all worked fine when debugging.
<runtime>
<assemblyBinding xmls="urn:schemas-microsoft-com:ASM.v1">
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="..." />
<bindingRedirect oldVersion="1.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
After publishing to iis the configurations I made just didn't allow the deployed server to run and the error pops up when you try to go to any path:
Directory does not exist
Parameter name: directory virtual path
My question is if runtime tag can or can't be used in iis and how to fix this and import the DLLs correctly. (Preferably without using nuget)

BindingRedirect not being honored within cloud service

I'm receiving an exception when initializing a cloud service:
System.IO.FileLoadException: Could not load file or assembly 'Microsoft.WindowsAzure.Storage, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Understanding that I have version 4.3.0.0 installed, I have added the following redirect into the app.config for my worker:
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
</dependentAssembly>
When run locally within the local emulator this resolves the issue. When this is packaged through cspack the app.config and worker.dll.config are included in the package.xml, both have the binding redirect included.
The 'Microsoft.WindowsAzure.Storage' is also included, both the .dll and .xml.
So as far as I see it, everything that is required during runtime has been supplied.
Unfortunately, the exception is telling me that the redirect has not been applied and it is still looking for version 2.1.0.0. Am I doing something wrong here?
Add a file named after your project so it'll match the name of the assembly.
{ProjectName}.dll.config with Copy to Output Directory = Always and Build action = None
This file has the same syntax as your app.config. It should contains your assembly bindings.
For some reason, the file generated from app.config is not included in the deployment package.

Does EF6 and SQL Server CE 4.0 work with VS2012 Express in 64bit?

When I attempt to:
Add a new ADO Entity Data Model
Select EF Designer from database
Select an existing database connection, include the connection string, and save it to app.config
Do NOT copy/modify the connection (I tried this with the copy and with a database that as already in my project)
I get an error
Your project references the latest version of the Entity Framework; however, an Entity Framework database provider compatible with this version could not be found for your data connection
I've been trying for hours to get this configuration to work without success. I am using the following:
Windows 7 64-bit
Visual Studio 2012 Express (C# application)
SQL Server Compact Edition 4.0 SP1 x64 ENU - I can't install the 32bit version on a 64-bit OS.
Entity Framework 6.1.0 dated 3/17/2014
EntityFramework.SqlServerCompact 6.1.0
I have tried uninstalling and re-installing components 3-5 multiple times.
I have the following in the app.config file (omitted the <entityFramework> section):
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SqlServerCe.4.0" />
<add name="Microsoft SQL Server Compact Data Provider 4.0"
invariant="System.Data.SqlServerCe.4.0"
description=".NET Framework Data Provider for Microsoft SQL Server Compact"
type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
</DbProviderFactories>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework">
<parameters>
<parameter value="System.Data.SqlServerCe.4.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="System.Data.SqlServerCe.4.0" type="System.Data.Entity.SqlServerCompact.SqlCeProviderServices, EntityFramework.SqlServerCompact" />
</providers>
</entityFramework>
</system.data>
I have rebuilt the solution multiple times with no errors. The application starts.
I have rebooted multiple times.
I have confirmed that the project is not referencing System.Data.Entity.
Please tell me I'm missing something simple.

Azure Diagnostics is looking for StorageClient 1.7.0.0, but I'm using StorageClient 1.7.1.0

I'm using the Microsoft.WindowsAzure.StorageClient version 1.7.1.0 available at: https://github.com/WindowsAzure/azure-sdk-for-net/tree/sdk_1.7.1. My project compiles just fine, but when I run it I get the following error:
Could not create Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
with an inner exception of:
Could not load file or assembly 'Microsoft.WindowsAzure.StorageClient, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"Microsoft.WindowsAzure.StorageClient, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
I looks like there is a dependency in Microsoft.WindowsAzure.Diagnostics on version 1.7.0.0 of Microsoft.WindowsAzure.StorageClient. However I am using version 1.7.1.0, and as far as I know I can't have both 1.7.0 and 1.7.1 in the same project. Any ideas how to make Microsoft.WindowsAzure.Diagnostics dependent on 1.7.1 if this is indeed the problem?
Thanks, Kurt
Update
As per recommendation below I added s startup task to load the version 1.7.0 using gacutil (this was useful http://blogs.infosupport.com/adding-assemblies-to-the-gac-in-windows-azure/). I have 2 WorkerRoles and 2 WebRoles. The problem I have now is that when I compile and run, VS2012 copies the 1.7.0 into the WebRoles' respective ...\csx\Debug\roles[WebRoleName]\approot folder, despite there being no direct reference to version 1.7.0 in the project. The following compile output shows the error this introduces when Azure attempts to load verison 1.7.1 (which it now can't find):
System.TypeLoadException: Unable to load the role entry point due to the following exceptions:
-- System.IO.FileLoadException: Could not load file or assembly 'Microsoft.WindowsAzure.StorageClient, Version=1.7.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'Microsoft.WindowsAzure.StorageClient, Version=1.7.1.0, Culture=neutral, PublicKeyToken=null'
=== Pre-bind state information ===
LOG: User = BERTIES_MAIN\kurt_000
LOG: DisplayName = Microsoft.WindowsAzure.StorageClient, Version=1.7.1.0, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///H:/Everything/Current_Work/Web_Apps/Azure/InSysCloud/InSysCloud/InSysCloud/csx/Debug/roles/InSysWatcher/approot
LOG: Initial PrivatePath = H:\Everything\Current_Work\Web_Apps\Azure\InSysCloud\InSysCloud\InSysCloud\csx\Debug\roles\InSysWatcher\approot
Calling assembly : InSysWatcher, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: H:\Everything\Current_Work\Web_Apps\Azure\InSysCloud\InSysCloud\InSysCloud\csx\Debug\roles\InSysWatcher\approot\InSysWatcher.dll.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\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:///H:/Everything/Current_Work/Web_Apps/Azure/InSysCloud/InSysCloud/InSysCloud/csx/Debug/roles/InSysWatcher/approot/Microsoft.WindowsAzure.StorageClient.DLL.
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
Why would VS2012 be adding the DLL for version 1.7.0, when 1.7.1 is referenced in the project itself, and version 1.7.0 is only included as content, and loaded into the GAC at app startup?
Well, in such cases you would use a binding redirect in the web.config/app.config. But the problem is the PublicKeyToken. The 'official' assembly 1.7.0.0 has the following PublicKeyToken: 31bf3856ad364e35.
Now, since you're building the 1.7.1.0 version yourself you'll end up with a different PublicKeyToken and in that case the binding redirect does not work.
But the GAC was built for this, to support multiple versions of an assembly. What I would suggest is the following:
Include the 1.7.0.0 assembly in your package, but add it as content (not as reference).
Create a startup task that deploys the assembly to the GAC (using gacutil), since the task will run before starting your role.
Keep using 1.7.1.0 with a normal assembly reference.
Your app should use 1.7.1.0 for your code, and the diagnostics assembly should be able to use version 1.7.0.0 from the GAC
I didn't have a chance to test this yet so I'm looking forword to your feedback.
It appears I can add the following reference into my web.config to work-around this problem:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.StorageClient"
publicKeyToken="31bf3856ad364e35"
culture="neutral" />
<bindingRedirect oldVersion="1.1.0.0"
newVersion="1.7.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.StorageClient"
publicKeyToken="31bf3856ad364e35"
culture="neutral" />
<publisherPolicy apply="no" />
</dependentAssembly>
</assemblyBinding>
</runtime>
This essentially allows the references to v1.1 of the dll to be re-mapped to 1.7.

Resources