Error while building C# project in VS Community (Dependancies Exchange) - c#

This is my first question here. I'm working on a Windows 8.1 with Visual Studio Community (Update 2). I'm building a small service in C# for my company that parses emails from an Exchange web service. In my solution, there are 2 projects: one built from scratch where I create the service and deal with emails, and the other one is a "Visual Studio Installer" that creates a small .exe to install the service with with all its dependencies.
The first project uses Microsoft.Exchange.WebServices.Auth and Microsoft.Exchange.WebServices libraries to communicate and parse emails from an exchange web service. These two dependencies are coming from NuGet. Both projects are built with the 4.5 .Net Framework. The installer has one main output which is the service project and has 4 dependencies:
Microsoft .NET Framwork.dll
Microsoft.Exchange.WebServices.Auth.dll
Microsoft.Exchange.WebServices.dll
System.net.HTTP.dll
The service works pretty well and I'm happy with it. I tried to update my code this week to see how I can write in the Windows journal. The issue is that since this week (30/05/2016) I can't regenerate my solution. I can build the first project (service one) and there are no issue but for the second one (installer), 4 warnings show up (both appear twice in DEBUG mode and 3 times in RELEASE mode):
WARNING: Unable to find dependency
'MICROSOFT.IDENTITYMODEL.EXTENSIONS' (Signature='69C3241E6F0468CA'
Version='2.0.0.0') of assembly
'Microsoft.Exchange.WebServices.Auth.dll'
WARNING: Unable to find dependency 'MICROSOFT.IDENTITYMODEL'
(Signature='31BF3856AD364E35' Version='3.5.0.0') of assembly
'Microsoft.Exchange.WebServices.Auth.dll'
These warnings explain the fact that the installer don't appear anymore in the DEBUG and RELEASE folder. I reverted the code I wrote and the error is the same. I also tried to create a new solution with the same project as 4.5 Framework basis and with an empty project but with the same dependencies I have the same warnings.
Do you guys have (had?) the same warnings?

I found a solution to my problem. My solution was saved directly on a remote hard drive. When I built the soution, .net framework was not found (my error). I re-create localy my solution and it works. Hope it will helps others.
Perhaps, I don't know why from one day to another .net was not found. Maybe Windows update has crashed during an update.

Related

Installing ASP .NET Core service to IIS using Visual Studio Installer Projects

I have a ASP .NET Core 3.1 application which is hosted as a windows service using IHostBuilder.UseWindowsService call. I am preparing a setup project using Visual Studio Installer Projects Extensions. The project is created as Web Setup project type so that the installer dialog already presents to the user selection of web page and application pool on IIS.
The problem I'm facing is that the assemblies are successfully installed in given folder on IIS, but the ApplicationService.deps.json is not installed. Without this file the application does not start successfully. As far as I have checked the file is created as part of the build in bin\x64\Release\netcoreapp3.1\ but is apparently not included by the Setup project.
I've played around also with Setup project's property PublishProfilePath by specify the profile that I generated when manually trying to publish from Visual Studio to IIS:
However, this produces even stranger results. The application is deployed to the IIS already when I build the Setup project! Then when check the newly created msi, it's size is really small and in fact does not install anything (completes successfully though).
Any help would be highly appreciated.
I managed to solve the problem, though I'm not sure if that's the optimal solution. In the setup project, you can include as part of the output also individual files. If I add the ApplicationService.deps.json it is marked with a relative path in the setup project itself. This means that once setup project is being build, the ApplicationService project is anyway built first as it's the primary output of setup project. At that point `ApplicationService.deps.json' is present in the Release folder. Then as msi is being created it's included as part of the output.
It works, but I would prefer that the setup project would include that file automatically.

M2Mqtt android/xamarin for some reason not working anymore

I built an xamarin cross platform mobile application last summer. We were waiting for the hardware to be ready for us to deploy the app.
Now everything is ready I kept a copy of the application on my one drive.
I copied the application from my one drive onto my development machine last week I have been working with it in debug mode.
Yesterday I tried to compile in release mode and all of a sudden my
using uPLibrary.Networking.M2Mqtt;
using uPLibrary.Networking.M2Mqtt.Messages;
grayed out and show error could not be found. Now I can't get anything to work the way it did even in debug mode all my mqtt commands are showing an error.
I tried reinstalling the nuget packages but I get error tying to compile to ......... not available in package see author
I just don't understand what happend and why
Please let me know if you have any ideas, from what I've read it may be because I moved the project from a different folder. Please help
You need M2Mqtt for .Net MQTT with uPLibrary. M2Mqtt will provide M2Mqtt.dll to support uPLibrary. You need to add M2Mqtt.dll reference in your project.
Please check M2Mqtt for .Net : MQTT client for Internet of Things & M2M communication.
What I did originally was find m2mqtt.mono.dll which worked fine for a while until I found some bugs that were fixed in more resent commits.
I have now gotten my hands on M2Mqtt.Net.dll which I just added to my Xamarin project and it seems to be working good.
I went to paho.mqtt.m2mqtt master. Downloaded git opened sln in Visual Studio 2017, built solution and got M2Mqtt.Net.dll from M2Mqtt/obj/debug folder and added reference to it in my project.
I'll keep you advised if I have any problems

.NET Framework version causing different behavior between two different machines?

I'm currently trying to debug a weird issue I'm having with some RESTful API calls. I built an Angular 2 scaffold and used the publish feature to create a standalone build which users can run by opening a command prompt and typing in "project --debug" -> this will start the scaffold service and users can submit API calls to retrieve data from files. This works perfectly fine on my machine and I can make the API calls just fine, but I have another computer where the results are different. The other computer always fails and lands in an Exception block when accessing a specific type of file.
I'm wondering if this may have to do with some kind of version mismatch/difference on the .NET Frameworks and/or Microsoft Visual C++ redistributables. The published build (original computer) was built using .NET 4.5.1 while the other computer only has 4.6.1 installed.
Has anyone encountered a similar situation where the exact same build yields different results? I'm currently uninstalling versions of .NET and redistributables to test this hunch out but I'm curious if some of you may have had a similar experience.
Seems like my issue is related to the Microsoft Visual C++ 2015 Redistributables - I removed the 2015 redistributables from the original machine (because it turns on the other machine did not have them), and I received the same results. Going deeper, I'm guessing this is because one of the DLLs was built using the 2015 redistributables.

Server Error in '/' Application after updating a dll in a C# .NET website project

We have a C# .NET website which was developed and maintained by a third party. I'm due to take over the general upkeep soon, so am trying to get a system going where I can maintain a local copy and deploy updates to the website. We need to make it work for two of us to work on for at least another month, after that I'm on my own.
We have an SVN of source, and an SVN of production published code. I can pull the solution and after some faffing I can make it build and run without problems locally. I'm using Visual Studio 2015, the target framework is 4.0.
I can update cshtml files, build, publish locally, and then copy these files over the website published version and it runs fine.
However, the bin/dlls that are produced, if copied into the website version, produces this fabulous error:
http://website.com/Error/InternalServerError?aspxerrorpath=/
Server Error in '/' Application. Runtime Error.
Description: An exception occurred while processing your request.
Additionally, another exception occurred while executing the custom error page for the first exception.
The request has been terminated.
If I copy back the dlls from the original, it works fine.
If I don't modify the code, but just build and publish the project, my dlls are still different sizes from the website versions.
The developers are using Visual Studio 2012, is this a factor? Why are the dlls for my local version (that runs fine) different, if I download the source and build/publish it with no changes?
The dlls in question by the way are a single one for the website itself, website.dll say, and one for 'objects' that they've dumped a load of functions into for doing various things, objects.dll, these are the only two I'm trying to copy over - all the other dlls match in size between my and the website versions.
I'm pretty new to this so may be making some fundamental mistakes here, but if I am, then our developer isn't picking up on them. I mean, I'm kind of not surprised that they're different, surely you need to deploy the whole project, and not just drop some dlls into an existing published folder? My developer is saying that's the only way we can do it...
Any tips of things I can try?
Thanks in advance.
Well, after a LOT of trial and error, I finally found a solution that works for me, for the moment:
Using nuget package manager, I reverted to Microsoft.AspNet.Mvc version 4.0.40804 for the project in question. This seems to have updated all the references and runtimes back to the 4.0.0.0 that the project was built using.
When I build, publish, and copy across the main dlls, the site now runs, rather than showing the 'Server Error in '/' Application. Runtime Error'
One thing, are there security implications for running such an old version? Maybe that needs to be a new question...
Thanks for all the help.

Update one DLL file in an ASP.NET website project

net development. I am working in a website project and I am trying to update one of the dll files. I've search for hours for a solution on stackoverflow, but no luck.
Our website project in Visual studios is composed of one website that uses three C# projects. I am trying to update just one of these C# projects. Currently the website is in production and the DLL files of these projects are in the /bin folder.
I opened up the solution in VS and made my changes.
I built the whole solution and retrieved the new dll.
I stopped our in-process website with IIS and overwrote the dll and restarted it again.
I get an Missing Method Exception as an error when I do this. I was hoping for a straight forward way of updating our website project because I only need to change about two lines of code and swapping dll files seems like the easiest way of doing this.
Thank you guys for your help and be patient with me I am a slow learner and I ask a lot of questions.
One of the reason of this to occur could be that your dll is built using different version of .net framework than what is on your server. You can check that and see if that resolves the issue.

Categories