Website Publish Fails - c#

I have a Web Application consuming a WebService. My web application has 2 projects - Startup and Other projects. I am able to build my solution and also run it without any problem in my local machine.
My Other project has a dll referenced named crypto. It is strongly named dll. Now I trying to publish my web app using File System. However it fails. Following are the errors.
The type or namespace name crypto could not be found (are you missing a using directive or an assembly reference)
From my output window
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "crypto". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
And finally it skips the Publish of website. Could anyone suggest me whats going on? Similarly I even had an WPF app and I was facing similar issue in Strongly Named dlls while creating Setup file. There I just put all the dlls in Special GAC folder and things worked. Here I am not sure.
Help would be appreciated.

Remove crypto dll from your projects, and add reference again , and be sure that crypto that you upload is exactly same as one you adding in reference. and then upload your project's dll again.

Related

*.cs.aspx cannot access *.cs files in App_Code folder

This site was developed a few years ago. it was working 100%. I am re-deploying to my pc to make some changes and testing. Now it cannot find those classes in those files. I have always used 4.5 Framework. I have searched for a solution, unfortunately those have not resolved my issue. including coping it into main directory. It worked when I copied the actual code into one of the *.cs.aspx files. However there are more then 20 pages using this email file. Any advice would be welcome. I have been scratching around for days. Thx.
===================ERROR========================>
The error is as follows:The type or namespace name 'Emailer' could not be found (are you missing a using directive or an assembly reference?)
===================ERROR-DISPLAY================>
Source Error:
Heading
As the message is saying you are most likely missing an Assembly reference. Look at the references of the old project (pic below) and make sure your new project has the same ones added.
If you locate any missing references you can add them by clicking on References > Add reference, and find it among the listed ones or browse to the physical path.
Go to class property window by right clicking on it. Look for build option here Change your class build option to compile.
You probably changed a Web Site Project to a Web Application Project. There are a couple of differences between these project types. Among them, in Web Application Projects, the App_Code directory seems to be ignored.

Appharbor build error: Could not locate the assembly "Microsoft.Exchange.WebServices"

I am new to AppHarbor and am getting this build error with my project (Asp.net / C# web service). My hello world worked fine and is deployed. However, this new method that I wrote connects to Exchange using EWS Managed package.
It works fine on my local, but not on AppHarbor. I have tried setting the Precompilation to False, but the error remains. Here is the detail text....Any pointers / help will be greatly appreciated.
1>Project "D:\temp\aeprsuko.xdi\input\exchangeservice\exchangeservice.sln" (1) is building "D:\temp\aeprsuko.xdi\input\exchangeservice\exchangeservice\exchangeservice.csproj" (2) on node 1 (default targets).
2>PrepareForBuild:
Creating directory "obj\Release\".
ResolveAssemblyReferences:
Primary reference "Microsoft.Exchange.WebServices".
2>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Exchange.WebServices". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\temp\aeprsuko.xdi\input\exchangeservice\exchangeservice\exchangeservice.csproj]
The problem is most likely that you're not pushing the relevant dll with your app, and if you are you are probably referencing it in the location it has on your local machine and lot the location that's local to your app.
Try using the NuGet package instead or make sure that you're pushing the dll with your code. There's more help on these sorts of problems in the FAQ.
In the references for your project you can try setting "Copy Local" to true?

Where in what files does the binary reference information be saved in VS.NET 2010 web project?

I have a vendor help develop a web project using VS.NET 2010. I got the delivered source codes from source code control system and tried to build it. There is an error message showing that one namespace is unknown, which is due to missing the reference of a .dll.
However, the vendor did add that reference into the web project and successfully built it in his own development environment. I know that for class library project, those reference information is saved in .csproj file. What about a file system web project? I did not see this information either in the .sln or the web application folder. Does anyone know where it is? I need to manually add the reference every time, which does not make any sense.
check the web.config file in the system.web/assemblies element

how to solve Could not load file or assembly 'Glimpse.Core' or one of its dependencies. Access is denied

When I run my project it's just fine and later suddenly when I run I got this error.
Because I no longer use it I remove the reference of all glimpse file and remove them from nuget pacakges too.
I have remove all configure Glimpse have set but I still got the problem. How I can resist this issue.
Could not load file or assembly 'Glimpse.Core' or one of its dependencies. Access is denied.
Exception Details: System.IO.FileLoadException: Could not load file or assembly 'Glimpse.Core' or one of its dependencies. Access is denied.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Glimpse.Core' could not be loaded.
I just had the same issue after removing Glimpse from a web project. The problem was that 2 Glimpse dlls (Glimpse.Ado and Glimpse.EF6) were still in the BIN folder of the website. If you remove them, your website will run again.
You have probably another program running that is using the same assembly.
Edit:
You could try to remove all references manually by opening the .csproj files in a texteditor and removing the Reference tag where the Include is glimpse. It looks like it though that there is still an assembly with a reference to this glimpse. Are you sure you removed all references and rebuild all dependencies?
I run into this problem when there was a common project referencing Glimpse.Ado.dll used by two web projects, and only one of these web projects was configured for glimpse (the web for UI). The other web project (web service project) did not need glimpse, but since it was referencing the same common projects from the solution, it got involved into glimpse as well. What helps is just add the reference to Glimpse.Core.dll also to the second web project that does not need it.

Cannot use external references with C# Console Application

I have tried all the suggestions below but still no joy.
I'm now trying a console application, and let me explain exactly what I'm doing.
I create a new console project in VS 2010
I add a number of references (dll's) some that aren't mine such as Castle.Winsor and N2 CMS dlls
in the console app I can add using statements indicating I am using name spaces within the referenced DLLs
I start writing code.
As soon as I compile all the code that uses the referenced DLLs immediately complains with "The type or namespace name '' could not be found (are you missing a using directive or an assembly reference?)"
I have tried setting the dlls to copy to local always, I have copied the DLL into the same directory, I have tried added reference by project and adding a reference to the DLL's themselves
I don't get this problem with a web application project or a ASP.net project they always work fine, only something that is compiled to an EXE like a console app or windows service.
there must be something I'm missing or I would have got this working by now.
Change the project Target to a non Client Profile target. Right click the Project and select Properties, you should see a list of Framework versions. As you are using VS2010, the Console project you've created by default targets .NET Framework 4.0 Client Profile, change that to .NET Framework 4.0.
Check if Copy Local is set to true for the referenced assembly.
First, as to your question, its hard to know exactly what you're doing wrong, but from the fact that you're using an underscore in an assembly name (and probably in namespaces and type names), it suggests you're rather new to the .NET world.
This suggests that you're adding references to other projects in your solution by browsing to the compiled assembly, rather than by adding a Project Reference. When adding a reference, you must select the Project tab rather than browsing for the assembly.
Even if you don't believe this is the issue, remove all references and re-add project references to make absolutely sure. Assumption, asses etc.
Once you've done that, I'd strongly suggest remove all the underscores from your types, namespaces and assemblies. You might want to go read the framework design guidelines, too.
Open your .Proj(Windows service project file) file in notepad and check whether your assembly location(data_object) is the same which you are pointing.
When you open .Proj file in notepad you can check for,
Project reference,
<ProjectReference Include="C:\StackOverflow\StackOverflow.csproj">
And if you giving dll or exe refrence then
<Reference Include="StackOverflow, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<ExecutableExtension>.exe</ExecutableExtension>
<HintPath>C:\StackOverflow\bin\Debug\StackOverflow.exe</HintPath>
</Reference>
I suggest you to give exact location including drive name like above example.
Other option you may try,
1. Clean and rebuild
2. Add Project reference if you already tried dll reference
3. Check whether the folder (referred assembly location) is Read Only then remove it.
In VS 2019, I had two projects, one C++ and other one C# Console in one solution file. When tried to add a dll reference through "Add reference", I was not able to see Browse button in "Reference Manager" window, to select dll file.
But when I created only C# Console app inside solution then I could add dll reference.

Categories