Deploy ASP.NET MVC5 to IIS7 assembly not Found - deployment

Publishing a MVC5-Project with VisualStudio2015 works fine, all files are created in a folder and the .dll appears in the subfolder /bin. I set up the project with a new ApplicationPool in my IIS7, connect with the created folder and start it . Now I get the message
file or assembly not found at /MyFolder.
When I look at the temporary files of the application (path is given in the error message), there is none.
Why does the IIS not find the assemblies in the publishing Folder?
The first assembly that is mentioned in the error message is a custom assembly which is added to the References of the MVC5 project.
Should I add the custom assemblies via Web.Release.config? How?

solved the problem.
Open the ApplicationPool in the IIS7, then right-click on the name of the website -> advanced settings -> Enable-32-bit-Applications = true
[Could not load file or assembly or one of its dependencies. Access is denied. The issue is random, but after it happens once, it continues answered by Fragment

Related

Stop Web Configuration Inheritence with Azure Virtual Web Application

I have created a web application project and deployed it to Azure.
In the web.config file for this application, a number of <assembly> elements appear in the <system.web><compilation> element. Specifically, these assembly entries point to DevExpress assemblies but they could really be anything.
I have also created a Web API project that is deployed as a virtual application under the web application. It looks like the <assembly> entries are being inherited from the configuration of the web application. The Web API project does not use these assemblies and throws an exception stating that they cannot be loaded.
As a temporary workaround, I have manually copied over the assemblies to the bin folder of the Web API application. However, this is not a permanent solution.
I have tried clearing the assembly entries in the Web API configuration (using the <clear /> element). I have also tried removing the entries (using the <remove> element). Neither of these worked.
What is the best way to stop this inheritance form occurring?
As mentioned in this official document about ASP.NET Configuration File Hierarchy and Inheritance:
ASP.NET application root directory > Web.config
The Web.config file for a specific ASP.NET application is located in the root directory of the application and contains settings that apply to the Web application and inherit downward through all of the sub directories in its branch.
ASP.NET application subdirectory > Web.config
The Web.config file for an application subdirectory contains settings that apply to this subdirectory and inherit downward through all of the subdirectories in its branch.
I assumed that you could leverage Location Settings to achieve your purpose. Also, there is a blog about Settings and Virtual Directory Inheritance, you could refer to it.

WSO2 Identity Server 5.1 management console customizing is not functioning

I tried to replace WSO2 Identity Server logo with my company logo in Main.Css file of corresponding jar.
But when I tried to restart the server the Jar file is not loading. Even if it is loading the logo is not getting displayed.
Any replies?
I believe you have changed the jar and replaced the existing one in repository/components/plugins folder. If so, this gets replaced by the original jars in repository/components/patches/patch0000 folder.
If this is the case what you can do is create a folder such as patch5000 in the patches folder and place the modified jar in it and restart. Let me know if this works.

SSIS Build Error: Could not copy file to the deployment utility output directory

Problem
When attempting to build an SSIS package deployment utility by right-clicking on the solution and choosing "build", the build fails with an error message similar to the following:
Error 204 System.ApplicationException: Could not copy file
"MyPath\MyFile.dtsConfig" to the deployment utility output directory
"MyPath\bin\Deployment".
---> System.IO.IOException: The file 'MyPath\MyFile.dtsConfig' already exists.
This error can be caused by casing differences in the configuration file path. In some instances SSIS will treat c:\MyPath\MyFile.dtsConfig differently than c:\mypath\MyFile.dtsConfig.
I tested this with two different computers connected to the same TFS server. One pc had TFS mapped to C:\Packages. The other pc had TFS mapped to C:\packages. Creating a package and running on the first pc would create the deployment without any problems. Trying to create the deployment package on the second pc would result in the could not copy exception.
I manually edited the .dtsx file on the second pc. Changing the casing of the configuration file path under DTS:ConfigurationString= in the .dtsx file allowed the package to work correctly.
To get the package to work on both computers I updated the local path for TFS to have the same casing.
Cause
This is caused when SSIS is attempting to deploy multiple copies of the .dtsconfig file to the output directory. By default, SSIS will copy both all dependent files (including .dtsconfig files) and any files added to the solution under the Miscellaneous folder.
If you have added the file to your solution, but failed to repoint the Package Configuration to the new location, both copies will be deployed, and the build will fail.
This scenario can occur when you:
Create a package using a Package Configuration with a .dtsconfig file
Copy the package to a new directory without editing the Package Configuration
Add the configuration file to the project by right-clicking the solution, choosing Add --> New Item, and navigating to the file
Build the package.
Solution
To fix this, repoint your Package Configuration to the file underneath your solution directory. This can be done through the editor, or can be done by viewing the XML code of your package and manually editing the path of the file, such as with the following:
<DTS:Configurations>
<DTS:Configuration
DTS:ConfigurationString="MyPath\MySolution\MyFile.dtsConfig"
DTS:ConfigurationType="1"
DTS:CreationName=""
DTS:DTSID="{93222D3D-7AFF-1F2D-9UB8-B5E7X256BBE5}"
DTS:ObjectName="MyFile" />
</DTS:Configurations>
Further reading can be found here.

Cannot load Entity Framework assembly in Azure website - The module was expected to contain an assembly manifest

I have an MVC4 web application running locally using Entity Framework 6. It is running as any CPU. When I deploy to Azure via web deploy the home page loads fine, but when I browse to a page that uses Entity Framework I see:
Could not load file or assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The module was expected to contain an assembly manifest.
I have tried building / deploying as X64 and x86. I have tried changing the platform mode between 32 and 64 bit in the Azure configure tab. I have tried Integrated and Classic modes. I have tried removing the package and reinstalling via NuGet.
Additionally if I try to run locally as X64 then it gives:
Could not load file or assembly 'ProjectName' or one of its dependencies. An attempt was made to load a program with an incorrect format.
This means it fails on the first page, before even getting to the page that uses Entity Framework.
How do I fix being able to use Entity Framework on Azure websites?
I had this same problem. Using FTP I noticed some unneeded DLLs in my bin folder, so I deleted all the DLLs and republished. That fixed it!

NUnit GUI Runner Multiple Configuration Files

I created a test project using a web.config file by renaming it to same name as the project, copying it to the bin folder and setting the Configuration File Name of the NUnit GUI runner to the name of my config file. Now I want to add more assemblies to this project but the problem here is each assembly has it's own web.config file.
How can I set the configuration files for the assemblies because I need to get my connection strings from these config files and considering when loading multiple assemblies they need to be in the same directory
While I feel that using config files for NUnit tests is a no-no (it's an integration test, in that case, I assume), there are various approaches you can try:
Put all your different connection strings under web.config in the connectionstrings section, with different keys. Access them via the System.Configuration classes.
For each project or DLL you can add an app.config file where you can store assembly specific information. This will be renamed as ProjectName.dll.config once compiled. Again you can access the contents of this file using System.Configuration
Create a new assembly that simply loads all these connection strings from a single file. And then access this assembly
If you are loading different web applications into the same directory (as you're saying you're accessing web.config files -- which means web applications) then you're making your life difficult. Each application has to have their own folder and virtual directory, and a web.config specific to only that application.