I would like to start using the web.config transform feature in Visual Studio when publishing to our test and production site. However, the release build fails while the debug build works fine.
I've believe I'm made the build settings the same. Although the only differences were 'Enable DEBUG constant', 'Enable optimizations', and 'Generate debug info'.
Anyway, the build error is "Could not load file or assembly 'file:...dll' or one of it's dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515).
The mentioned dll was from the Ajax Control Toolkit. I used Nuget to 'install' the Ajax Control Tookit package instead of just including a reference to the dll. Then I got the same error for Microsoft's AntiXSS. So I again used Nuget to 'install' AntiXSS. Unfortunately, now I'm getting this error on another third party API that doesn't have a Nuget installer. Also, I'm getting this error on a dll I've created that I include in a number of projects here.
Does someone know what is causing this error? What should I do to fix this error? Do I need to create a Nuget package?
Thanks
Related
Background:
I have several ASP.NET projects under one solution file. I have a build pipeline for ASP.NET projects and building it with .sln.
Now, we have added a new project to the same .sln which is in .NET CORE.
Problem statement:
In my build pipeline, when I try to build the whole solution, it throws an exception to the newly added project. (.NET CORE)
"The type or namespace name 'Entity' does not exist in the namespace
'System.Data' (are you missing an assembly reference?)"
I believe this is due to framework versions.
Question:
Is it possible to have both projects under one build pipeline, if yes, how can I achieve it? if not, what would be the ideal solution?
Additional information: From the visual studio, everything is building and working fine, but I build the project pipeline it's throwing this error.
Initially build the code from visual studio to avoid errors while building in the azure pipeline.
Used different projects in azure pipeline
Create a repository using Visual Studio or Azure Devops.
Fill the necessary fields while creating a repository
Then it enters into a Git Credential Manager screen and have to choose the account from which you want to create and proceed further.
Create branches if required.
Using Visual Studio, we can sync and push the changes made from the specific branch
Create a pipeline with azure subscription and build the code.
Refer this link for more info.
You could add a reference to System.Data.Entity to test if the exception is thrown again.
Or you could refer to this document for more details about Organize your project to support both .NET Framework and .NET
================================================================
updated on 11/30
This error message indicates the build process can't find the assemblies coming from the restored nuget packages. So you should check the log of the restore task in build-pipeline to make sure the packages are restored successfully.
Make sure you have use nuget tool install and nuget restore tasks before your build task like this, if your build include private feed, please add the nuget authenticate task to restore the project correctly. (Avoid using dotnet related tasks cause your project targets .net framework, and dotnet task could not recognize .sln projects)
I was able to resolve this by updating the NuGet package version for the pipeline. Same as the application version.
We have an ASP.NET app with N number of projects. Two projects both reference a third party library - DocumentFormat.OpenXml.dll. One project - project A - references version 2.0.5022.0 of the library. Another project - project B - references version 2.5.5631.0 of the library. We get a build warning when the solution is built about the conflict between the two versions of the same DLL. Version 2.5.5631.0 is the version that ends up in the \bin directory.
At runtime, when I test the functionality provided by assembly A (built from project A) on an internal QA server, the functionality works. However, that's not what I expected. I expected to get a System.IO.FileLoadException error:
System.IO.FileLoadException: Could not load file or assembly 'DocumentFormat.OpenXml, Version=2.0.5022.0...
Note that there are no bindingRedirects for this DLL in the web.config file of the app.
The reason why this issue came to my attention is that we are in fact getting the System.IO.FileLoadException error message on a customer's server. I can't understand why we're not getting the same error on our QA server. Any ideas?
I read about Web API having its own TraceWriter implementation with 2012.2, for example here, among other sources.
I am now using VS2013 with .NET 4.5.1 and the EnableSystemDiagnosticsTracing is nowhere to be found. It's meant to be defined in the HttpConfigurationTracingExtensions class which resides in the System.Web.Http.Tracing.dll. However, this assembly is nowhere to be found - not in list of assemblies in the Add Reference dialog, not in GAC.
Where is this assembly supposed to come from? Docs say it's part of .NET Framework 4, which I have installed. Also installed the ASP.NET Web API 2 Tracing 5.0.0 NuGet package. Is there some update? Should I re-install .NET Framework?
I know it's not a big deal to implement ITraceWriter myself but it bothers me not to know what happened with the built-in implementation.
Just install needed NuGet Package
Install-Package Microsoft.AspNet.WebApi.Tracing -Version 5.0.0
It's a little bit strange, but it is the right package
http://www.nuget.org/packages/microsoft.aspnet.webapi.tracing
If you installed the Tracing 5.0.0 NuGet package, it should be correctly included in your project. The moment it is installed, I believe a separate text file should open in VS showing the code you should include in your WebApiConfig.cs file.
I haven't created a Web API 2 project from scratch (only upgraded from pre-5.0 to 5.0 projects), but this is the code that should reside in your WebApiConfig.cs file:
// To disable tracing in your application, please comment out or remove the following line of code
// For more information, refer to: http://www.asp.net/web-api
config.EnableSystemDiagnosticsTracing();
And that should be it, if the package is installed correctly, tracing should now be used in your project.
I have an Asp.Net website project that builds fine locally with VS2010 and from the command line with msbuild. The problem is its failing on our build server (CruiseControl.net) with this circular file reference issue
/tms/_master/help.master(1): error ASPPARSE: Circular file references are not allowed. [C:\ccnet\working\master\Tms.Rms.Website\tms.metaproj]
/tms/_master/reporting-detail.master(2): error ASPPARSE: Circular file references are not allowed. [C:\ccnet\working\master\Tms.Rms.Website\tms.metaproj]
/tms/_master/mvc.master(1): error ASPPARSE: Circular file references are not allowed. [C:\ccnet\working\master\Tms.Rms.Website\tms.metaproj]
I don't see anything obvious about the way pages/folders/or controls are laid out as suggested in other questions related to this error, and I have zero feedback from VS2010 locally as it doesn't have the problem at all. (it builds ok)
Anyone know how I can track this issue down locally, or what may be the cause of different build results between machines?
Local build environment: vs2010, msbuild 4.0, building as myself
Build server environment: msbuild 4.0, building as ccnet service account (no vs2010 installed or available)
I also have the same version of ccnet setup locally with he same configuration building successfully.
It's worth noting that the circular reference errors above seem to occur on "nested" master pages with the MasterPageFile attribute. e.g.
<%# Master MasterPageFile="~/_master/base.master" CodeFile="help.master.cs" Inherits="_master_help" %>
I have a Silverlight site hosted in an asp page, it has been developed using vs2010 using .net 3.5 framework and silverlight 4. It all works on my dev box. However when I publish the site and get it deployed I get the error:
Could not load file or assembly 'Moe.Tactical.Ttas.Web' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.BadImageFormatException: Could not load file or assembly 'Moe.Tactical.Ttas.Web' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
I have checked that the ISS asp setting are using 2.0.50727, and that all my references are using that runtime also.
I am not sure what to do to work out what the missing dependencies are at this point (I don't have access to the deployment box, I will have to go and sit with a system admin).
This looks like a case of the GAC, and nothing to do with Silverlight/VS 2010/whatever.
Basically that assembly lives in the GAC of your dev box, but now on your production box, and the DLL is not included in your build.
I was actually exactly the opposite of 'TheGeekYouNeed's suggestion ... the system administrator had not followed my instructions, and had included a couple of extra assemblies in my bin folder, lol.
So interestingly it was complaining about having an extra file! (well actually an extra file that was probably a .net 4 one)