I just started using WiX, with zero knowledge of C#/.NET
Now I'm trying to create a simple WiX extension by referring this page: WiX3 - Simple Example of Extension.
Here is steps described in that page:
In Visual Studio, create a new C# library (.dll) project named SampleWixExtension.
Add a reference to wix.dll to your project.
Add a using statement that refers to the Microsoft.Tools.WindowsInstallerXml namespace.
using Microsoft.Tools.WindowsInstallerXml;
Make your SampleWixExtension class inherit from WixExtension.
public class SampleWixExtension : WixExtension {}
Add the AssemblyDefaultWixExtensionAttribute to your AssemblyInfo.cs.
[assembly: AssemblyDefaultWixExtension(typeof(SampleWixExtension.SampleWixExtension))]
Build the project.
However, when I finished these steps and built this project, I met following errors:
------ Build started: Project: SampleWixExtension, Configuration: Debug Any CPU ------
D:\working\test\SampleWixExtension\SampleWixExtension\Properties\AssemblyInfo.cs(37,12): error CS0246: The type or namespace name 'AssemblyDefaultWixExtension' could not be found (are you missing a using directive or an assembly reference?)
D:\working\test\SampleWixExtension\SampleWixExtension\Properties\AssemblyInfo.cs(37,12): error CS0246: The type or namespace name 'AssemblyDefaultWixExtensionAttribute' could not be found (are you missing a using directive or an assembly reference?)
Compile complete -- 2 errors, 0 warnings
Anyone know why and how to fix it?
Btw, in the Solution Explorer I can see wix is already in References, its properties has Path of C:\Program Files (x86)\Windows Installer XML v3.5\bin\wix.dll
By adding
using Microsoft.Tools.WindowsInstallerXml;
into AssemblyInfo.cs, the project is now successfuly built.
Related
I am working with .net core 5. I have folder structure like below.
Project
Project core
Project business
Project infrastructure
In "Project", System namespace working fine. But in other "Project" directory it shows error for namespace "System"
Here is the one which i am getting in output
NuGet package restore failed. Please see Error List window for detailed warnings and errors
Few more errors in error list i am facing are as below
First and foremost, I've never worked with C#, or any compiled language for that matter. So I'm hoping I'm just doing something wrong here.
We have an old in house app, written in c# that has some smtp settings hard coded that need to be changed. I have the source files, and even the .sln visual studio project file. So I open the project in vs, make the required changes, and go to build- however I'm running into errors (Build -> Build 'Autodocs' (the name of our app)):
Build started...
1>------ Rebuild All started: Project: AutoDocs, Configuration: Debug Any CPU ------
1>C:\shared\New folder\AutoDocs\Microsoft\Office\Interop\Word\Documents.cs(10,38,10,54): error CS0234: The type or namespace name 'CustomMarshalers' does not exist in the namespace 'System.Runtime.InteropServices' (are you missing an assembly reference?)
1>C:\shared\New folder\AutoDocs\AutoDocs\modules\DWStorer.cs(7,7,7,15): error CS0246: The type or namespace name 'DocuWare' could not be found (are you missing a using directive or an assembly reference?)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
So does anybody have any suggestions for a c# newbie like me? Anything I should have to do when copying a project dir from the server to my pc to build it?
Thank you in advance.
Do you know what kind of program it is? Windows? ASP.NET? MVC?
The errors are shown, but let's go through them:
1>C:\shared\New folder\AutoDocs\Microsoft\Office\Interop\Word\Documents.cs(10,38,10,54):
error CS0234: The type or namespace name 'CustomMarshalers' does not exist in the
namespace 'System.Runtime.InteropServices' (are you missing an assembly reference?)
First, look in this document:
C:\shared\New folder\AutoDocs\Microsoft\Office\Interop\Word\Documents.cs
Somewhere in that file, when viewing in Visual Studio, you will see the word CustomMarshalers, and it needs to be referenced.
So, in your project, you will need to right-click the References section and add that missing reference (if it isn't there already):
Also, at the top of your Documents.cs file, you need to have a line like this:
using System.Runtime.InteropServices;
See Microsoft's documentation here: System.Runtime.InteropServices.CustomMarshalers
Here is your second error:
>C:\shared\New folder\AutoDocs\AutoDocs\modules\DWStorer.cs(7,7,7,15):
error CS0246: The type or namespace name 'DocuWare' could not be found
(are you missing a using directive or an assembly reference?)
Similar to the first error, this one is having an error in the DWStorer.cs file because it cannot resolve the keyword DocuWare.
DocuWare is a third party tool that must be added to your references and added to the top of your DWStorer.cs file.
DocuWare
You may have to go to the link above to download their tool if you do not have it in your project somewhere.
UnitTest1.cs(131,10): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?)
16:42:40
UnitTest1.cs(131,10): error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?)
16:42:40
UnitTest1.cs(144,10): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?)
Why i cannot build the test project in Msbuild Teamcity using the
project solution file?
First of all, you should make sure that you can build your test project successfully locally.
Then, follow these suggestions:
Suggestions
First, Before Teamcity 9.1.5, you should install Microsoft Visual Studio edition on the build agent and make sure that you install the right version. Please see this official document.
Since TeamCity 9.1.5, the Visual Studio Test Runner supports Visual Studio Test Agent installed on the agent machine (Microsoft Visual Studio is no longer required). You can refer to this link.
Second, you should do the restoration of the nuget packages at VCS before build step.
See this.
I make my project based on this tutorial:
https://learn.microsoft.com/en-us/aspnet/core/tutorials/grpc/grpc-start?view=aspnetcore-3.1&tabs=visual-studio
It told me that it is missing directive or an assembly reference.
But I instal the related plugin, and the code generate successfully, I don't know why VS still can't find the code...
Here is the code content, the namespace is exist:
More info my proto properties:
Error Msg:
1>MainWindow.xaml.cs(6,7,6,23): error CS0246: The type or namespace
name 'HeartBeatMessage' could not be found (are you missing a using
directive or an assembly reference?)
1>MainWindow.xaml.cs(16,24,16,40): error CS0246: The type or namespace
name 'HeartBeatService' could not be found (are you missing a using
directive or an assembly reference?)
I found this question because I was running into this problem too. See: https://github.com/grpc/grpc/issues/20402
For now, I have manually moved the generated .cs files into my project and disabled the build step on the .proto (otherwise VS will complain about double definitions).
We share our classes between silverlight 3.0 client and server as is it described here. Everything works fine under Visual Studio 2008 only. Using msbuild with following command line parameters:
C:\Windows\Microsoft.NET\Framework\v3.5\msbuild.exe FoobarApplication.sln /t:Rebuild /p:Configuration=Release /p:Platform="Any CPU"
we get following error:
Class1.cs(28,54): error CS0234: The type or namespace name 'WcfService' does not exist in the namespace 'Company.FoobarApplication' (are you missing an assembly reference?)
Service References\geoServiceReference1\Reference.cs(24,81): error CS0234: The type or namespace name 'WcfService' does not exist in the namespace 'Company.FoobarApplication' (are you missing an assembly reference?)
Done Building Project "C:\work\bov-tmp\FoobarApplication\SilverlightClassLibrary3\SilverlightClassLibrary3.csproj" (Rebuild target(s)) -- FAILED.
Done Building Project "C:\work\bov-tmp\FoobarApplication\FoobarApplication.sln" (Rebuild target(s)) -- FAILED.
I found exactly the same question here. There are 4 workarounds there, I tried first 3 of them and those did not worked out. The 4-th workaround is not the acceptable solution.
Any thoughts how to build the solution?
Resolved the problem. The geoServiceReference1 project was referencing our RUI.Web project. That stupid reference appeared somehow after the solution reorganization.